diff --git a/data/caixes.gif b/data/caixes.gif index 7f8a8e3..9135bdd 100644 Binary files a/data/caixes.gif and b/data/caixes.gif differ diff --git a/data/rooms/00.txt b/data/rooms/00.txt index 3154c53..899e2d1 100644 --- a/data/rooms/00.txt +++ b/data/rooms/00.txt @@ -42,7 +42,7 @@ actor{ bmp: test.gif bmp-rect: 32 0 32 32 bmp-offset: 0 32 - pos: 16 28 4 + pos: 12 28 4 size: 8 8 8 flags: PUSHABLE GRAVITY } diff --git a/data/rooms/01.txt b/data/rooms/01.txt index 3cddf12..5bf190b 100644 --- a/data/rooms/01.txt +++ b/data/rooms/01.txt @@ -7,3 +7,63 @@ wall-texture: 0 door-texture: 0 under-door-texture: 0 exit-xp: 0 + +actor{ + name: BOX + bmp: caixes.gif + bmp-rect: 64 32 24 32 + bmp-offset: -8 36 + pos: 8 8 0 + size: 8 4 5 + movement: CW +} + +actor{ + name: BOX01 + bmp: caixes.gif + bmp-rect: 96 32 24 32 + bmp-offset: -8 36 + pos: 8 8 8 + size: 8 4 8 + movement: CW +} + +actor{ + name: BOX02 + bmp: test.gif + bmp-rect: 32 0 32 32 + bmp-offset: 0 32 + pos: 8 32 0 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX03 + bmp: test.gif + bmp-rect: 32 0 32 32 + bmp-offset: 0 32 + pos: 8 34 8 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX04 + bmp: test.gif + bmp-rect: 32 0 32 32 + bmp-offset: 0 32 + pos: 8 38 16 + size: 8 8 8 + movement: CW +} + +actor{ + name: BOX05 + bmp: test.gif + bmp-rect: 32 0 32 32 + bmp-offset: 0 32 + pos: 8 40 24 + size: 8 8 8 + movement: CW +} diff --git a/data/rooms/02.txt b/data/rooms/02.txt new file mode 100644 index 0000000..89aef12 --- /dev/null +++ b/data/rooms/02.txt @@ -0,0 +1,9 @@ +width: 2 +height: 1 +door-height-yp: 0 +color: BLUE +floor-texture: 1 +wall-texture: 2 +door-texture: 0 +under-door-texture: 0 +exit-zp: 0 diff --git a/source/actor.cpp b/source/actor.cpp index 0310da4..c3331e3 100644 --- a/source/actor.cpp +++ b/source/actor.cpp @@ -421,7 +421,7 @@ namespace actor act->push |= PUSH_XN; } } - if ( input::keyDown(SDL_SCANCODE_RIGHT) ) + else if ( input::keyDown(SDL_SCANCODE_RIGHT) ) { act->orient=PUSH_XP; if ( ((act->pos.x+act->size.x)pos.y>=min.y && (act->pos.y+act->size.y)<=max.y) || ( (room::getDoors()&DOOR_XP) && (act->pos.y>=24) && (act->pos.y<=32) ) ) @@ -438,7 +438,7 @@ namespace actor act->push |= PUSH_XP; } } - if ( input::keyDown(SDL_SCANCODE_UP) ) + else if ( input::keyDown(SDL_SCANCODE_UP) ) { act->orient=PUSH_YN; if ( (act->pos.y>min.y && act->pos.x>=min.x && (act->pos.x+act->size.x)<=max.x) || ( (room::getDoors()&DOOR_YN) && (act->pos.x>=24) && (act->pos.x<=32) ) ) @@ -455,7 +455,7 @@ namespace actor act->push |= PUSH_YN; } } - if ( input::keyDown(SDL_SCANCODE_DOWN) ) + else if ( input::keyDown(SDL_SCANCODE_DOWN) ) { act->orient=PUSH_YP; if ( ((act->pos.y+act->size.y)pos.x>=min.x && (act->pos.x+act->size.x)<=max.x) || ( (room::getDoors()&DOOR_YP) && (act->pos.x>=24) && (act->pos.x<=32) ) ) @@ -717,7 +717,15 @@ namespace actor if (act->push & PUSH_ZN) { // Si estic sobre el piso, no faig res [TODO]: Si no hi ha piso ha de caure - if (act->pos.z == 0) return; + if (act->pos.z == 0) + { + if ((act->flags&FLAG_HERO)==0 || room::getExit(ZN)==-1) return; + + room::load(room::getExit(ZN)); + act->pos.z = room::getMax().z; + actor::setDirty(act); + return; + } // Si tinc a algĂș baix... if (act->below) diff --git a/source/room.cpp b/source/room.cpp index a250b51..804a110 100644 --- a/source/room.cpp +++ b/source/room.cpp @@ -61,7 +61,7 @@ namespace room tmin = {3-inner_w,3-inner_h,0}; tmax = {4+inner_w,4+inner_h,3}; min = {tmin.x*8,tmin.y*8,0}; - max = {(tmax.x+1)*8,(tmax.y+1)*8,24}; + max = {(tmax.x+1)*8,(tmax.y+1)*8,32}; doors = (door_height[XP]>=0?DOOR_XP:0) | (door_height[XN]>=0?DOOR_XN:0) | (door_height[YP]>=0?DOOR_YP:0) | (door_height[YN]>=0?DOOR_YN:0); //door_height[0] = inner_xp; //XP //door_height[1] = inner_xn; //XN