- [FIX] Ja no pot caminar en diagonal

- Treballant en l'eixida del piso (encara peta)
This commit is contained in:
2024-06-16 22:06:27 +02:00
parent d587b5a0a4
commit 219bdd96b3
6 changed files with 83 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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
}

View File

@@ -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
}

9
data/rooms/02.txt Normal file
View File

@@ -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

View File

@@ -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)<max.x && act->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)<max.y && act->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)

View File

@@ -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