- [FIX] Retocades les coordenades d'entrada de l'heroi

- [NEW] Amb CTRL+cursors es pot moure de 8 en 8 en l'editor
- [DEL] Ja no es pot canviar d'actor amb ctrl+cursors en l'editor
- [NEW] Ja estic fent les habitacions definitives. Ahi si que no vull spoilechar
This commit is contained in:
2024-07-30 20:41:52 +02:00
parent 2ec21a2c2a
commit dc24aa009b
8 changed files with 421 additions and 83 deletions

View File

@@ -38,16 +38,6 @@ actor{
movement: CW movement: CW
} }
actor{
name: LAMPARA
bmp: altres.gif
bmp-rect: 128 0 20 41
bmp-offset: -6 45
pos: 1 41 0
size: 6 6 16
movement: CW
}
actor{ actor{
name: LLIT name: LLIT
bmp: altres.gif bmp: altres.gif
@@ -77,3 +67,95 @@ actor{
size: 6 4 2 size: 6 4 2
movement: CW movement: CW
} }
actor{
name: KALLAX-A
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: -8 31
pos: 32 16 0
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: LAMPARA
bmp: altres.gif
bmp-rect: 128 0 20 41
bmp-offset: -6 45
pos: 1 41 0
size: 6 6 16
movement: CW
}
actor{
name: KALLAX-A03
bmp: altres.gif
bmp-rect: 72 48 24 27
bmp-offset: -8 31
pos: 40 16 0
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: BOX
bmp: caixes.gif
bmp-rect: 32 0 32 32
bmp-offset: 0 32
pos: 46 40 0
size: 8 8 8
flags: PUSHABLE
movement: CW
}
actor{
name: BOX01
bmp: caixes.gif
bmp-rect: 0 0 32 32
bmp-offset: 0 32
pos: 56 40 0
size: 8 8 8
flags: PUSHABLE
movement: CW
}
actor{
name: KALLAX-A01
bmp: altres.gif
bmp-rect: 24 48 24 27
bmp-offset: -8 31
pos: 32 16 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: KALLAX-A02
bmp: altres.gif
bmp-rect: 48 48 24 27
bmp-offset: -8 31
pos: 40 16 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: BOX02
bmp: caixes.gif
bmp-rect: 0 0 32 32
bmp-offset: 0 32
pos: 52 40 8
size: 8 8 8
orient: YP
flags: PUSHABLE ORIENTABLE
movement: CW
}

View File

@@ -11,7 +11,17 @@ exit-xn: 1
exit-yn: 3 exit-yn: 3
actor{ actor{
name: BOX02 name: KALLAX-01
bmp: altres.gif
bmp-rect: 48 48 24 27
bmp-offset: 0 31
pos: 0 12 0
size: 4 8 8
movement: CW
}
actor{
name: ARMARI-B1
bmp: caixes.gif bmp: caixes.gif
bmp-rect: 64 32 24 32 bmp-rect: 64 32 24 32
bmp-offset: -8 36 bmp-offset: -8 36
@@ -21,30 +31,7 @@ actor{
} }
actor{ actor{
name: KALLAX-A name: ARMARI-A1
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: 0 31
pos: 0 12 0
size: 4 8 8
movement: CW
}
actor{
name: ROOMBA01
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 8 24 0
size: 8 8 2
orient: YP
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CW
}
actor{
name: BOX
bmp: caixes.gif bmp: caixes.gif
bmp-rect: 64 32 24 32 bmp-rect: 64 32 24 32
bmp-offset: -8 36 bmp-offset: -8 36
@@ -54,7 +41,52 @@ actor{
} }
actor{ actor{
name: BOX02 name: BOX01
bmp: caixes.gif
bmp-rect: 0 0 32 32
bmp-offset: 0 32
pos: 13 16 0
size: 8 8 8
flags: PUSHABLE
movement: CW
}
actor{
name: BOX
bmp: caixes.gif
bmp-rect: 32 0 32 32
bmp-offset: 0 32
pos: 14 24 0
size: 8 8 8
flags: PUSHABLE
movement: CW
}
actor{
name: ROOMBA-01
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 8 32 0
size: 8 8 2
orient: YP
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CW
}
actor{
name: KALLAX-02
bmp: altres.gif
bmp-rect: 72 48 24 27
bmp-offset: 0 31
pos: 0 12 8
size: 4 12 8
movement: CW
}
actor{
name: ARMARI-B2
bmp: caixes.gif bmp: caixes.gif
bmp-rect: 96 32 24 32 bmp-rect: 96 32 24 32
bmp-offset: -8 36 bmp-offset: -8 36
@@ -64,7 +96,7 @@ actor{
} }
actor{ actor{
name: BOX01 name: ARMARI-A2
bmp: caixes.gif bmp: caixes.gif
bmp-rect: 96 32 24 32 bmp-rect: 96 32 24 32
bmp-offset: -8 36 bmp-offset: -8 36
@@ -74,17 +106,7 @@ actor{
} }
actor{ actor{
name: KALLAX-A01 name: PILOTA
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: 0 31
pos: 0 12 8
size: 4 12 8
movement: CW
}
actor{
name: ROOMBA02
bmp: altres.gif bmp: altres.gif
bmp-rect: 0 108 22 22 bmp-rect: 0 108 22 22
bmp-offset: -5 24 bmp-offset: -5 24
@@ -115,6 +137,19 @@ actor{
movement: CW movement: CW
} }
actor{
name: ROOMBA-02
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 56 24 0
size: 8 8 2
orient: YP
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{ actor{
name: BOOSTER name: BOOSTER
bmp: objectes.gif bmp: objectes.gif
@@ -127,15 +162,3 @@ actor{
flags: ANIMATED SPECIAL flags: ANIMATED SPECIAL
movement: CW movement: CW
} }
actor{
name: ROOMBA
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 56 24 0
size: 8 8 2
orient: YP
flags: MOVING
movement: CCW
}

View File

@@ -1,5 +1,5 @@
width: 2 width: 2
height: 3 height: 2
door-height-xn: 0 door-height-xn: 0
door-height-yp: 0 door-height-yp: 0
color: CYAN color: CYAN
@@ -9,3 +9,135 @@ door-texture: 0
under-door-texture: 0 under-door-texture: 0
exit-xn: 4 exit-xn: 4
exit-yp: 2 exit-yp: 2
actor{
name: BATMAN
bmp: gat.gif
bmp-rect: 0 0 24 28
bmp-offset: -4 32
pos: 8 8 0
size: 8 8 8
orient: YP
anim-wait: 2
flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY
react-mask: XP XN YP YN ZP ZN
movement: Y
}
actor{
name: MESITA
bmp: caixes.gif
bmp-rect: 160 96 32 32
bmp-offset: 0 32
pos: 24 8 0
size: 8 8 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: BOX
bmp: test.gif
bmp-rect: 32 0 32 32
bmp-offset: 0 32
pos: 24 32 0
size: 8 8 8
flags: PUSHABLE
movement: CW
}
actor{
name: ARMARI01
bmp: caixes.gif
bmp-rect: 64 32 32 32
bmp-offset: 8 36
pos: 8 40 0
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: BOX01
bmp: test.gif
bmp-rect: 32 0 32 32
bmp-offset: 0 32
pos: 19 40 0
size: 8 8 8
flags: PUSHABLE
movement: CW
}
actor{
name: WC
bmp: altres.gif
bmp-rect: 105 0 21 33
bmp-offset: -4 36
pos: 40 8 0
size: 8 8 6
movement: CW
}
actor{
name: ROBIN
bmp: gat2.gif
bmp-rect: 0 0 24 28
bmp-offset: -4 32
pos: 40 48 0
size: 8 8 8
orient: XP
anim-wait: 2
flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY
react-mask: XP XN YP YN ZP ZN
movement: X
}
actor{
name: FINESTRA
bmp: altres.gif
bmp-rect: 0 75 20 33
bmp-offset: -10 38
pos: 24 7 8
size: 1 1 9
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: KALLAX-A
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: -8 31
pos: 13 8 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: KALLAX-A01
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: -8 31
pos: 48 8 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: ARMARI02
bmp: caixes.gif
bmp-rect: 96 32 32 32
bmp-offset: 8 36
pos: 8 40 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}

View File

@@ -1,11 +1,86 @@
width: 2 width: 3
height: 2 height: 1
door-height-xp: 0 door-height-xp: 0
door-height-xn: 0 door-height-xn: 0
color: CYAN color: WHITE
floor-texture: 0 floor-texture: 1
wall-texture: 0 wall-texture: 6
door-texture: 0 door-texture: 6
under-door-texture: 0 under-door-texture: 6
exit-xp: 3 exit-xp: 3
exit-xn: 5 exit-xn: 5
actor{
name: ROOMBA
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 8 16 0
size: 8 8 2
orient: YP
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: Y
}
actor{
name: KALLAX-A
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: -8 31
pos: 8 16 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: KALLAX-A01
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: -8 31
pos: 24 16 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: KALLAX-A02
bmp: altres.gif
bmp-rect: 0 48 24 27
bmp-offset: -8 31
pos: 40 16 8
size: 8 4 8
orient: YP
flags: ORIENTABLE
movement: CW
}
actor{
name: ROOMBA01
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 24 24 0
size: 8 8 2
orient: YP
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: Y
}
actor{
name: ROOMBA02
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 40 32 0
size: 8 8 2
orient: YP
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: Y
}

View File

@@ -8,15 +8,29 @@ door-texture: 0
under-door-texture: 0 under-door-texture: 0
exit-xp: 4 exit-xp: 4
actor{
name: ROOMBA
bmp: caixes.gif
bmp-rect: 160 0 32 32
bmp-offset: 0 34
pos: 32 32 0
size: 8 8 2
orient: XN
flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CCW
}
actor{ actor{
name: GAT-NEGRE name: GAT-NEGRE
bmp: gat.gif bmp: gat.gif
bmp-rect: 0 0 24 28 bmp-rect: 0 0 24 28
bmp-offset: -4 32 bmp-offset: -4 32
pos: 8 8 0 pos: 32 32 2
size: 8 8 8 size: 8 8 8
orient: XP orient: XP
anim-wait: 2 anim-wait: 2
flags: MOVING ANIMATED ORIENTABLE flags: PUSHABLE REACTIVE DEADLY GRAVITY
react-mask: XP XN YP YN ZP ZN
movement: CCW movement: CCW
} }

View File

@@ -1,11 +1,12 @@
actor{ actor{
name: BOX name: BOX
bmp: test.gif bmp: caixes.gif
bmp-rect: 32 0 32 32 bmp-rect: 32 0 32 32
bmp-offset: 0 32 bmp-offset: 0 32
pos: 32 32 0 pos: 32 32 0
size: 8 8 8 size: 8 8 8
flags: PUSHABLE
movement: CW movement: CW
} }
@@ -260,9 +261,20 @@ actor{
bmp: caixes.gif bmp: caixes.gif
bmp-rect: 160 0 32 32 bmp-rect: 160 0 32 32
bmp-offset: 0 34 bmp-offset: 0 34
pos: 56 24 0 pos: 32 32 0
size: 8 8 2 size: 8 8 2
orient: XN orient: XN
flags: MOVING flags: REACTIVE MOVING DEADLY
react-mask: XP XN YP YN ZP ZN
movement: CCW movement: CCW
} }
actor{
name: WC
bmp: altres.gif
bmp-rect: 105 0 21 33
bmp-offset: -4 36
pos: 8 8 0
size: 8 8 8
movement: CW
}

View File

@@ -1353,7 +1353,7 @@ namespace actor
void init(const bool complete) void init(const bool complete)
{ {
actor::actor_t *hero = actor::create("HERO", {16,32,8}, {6,6,12}, "test.gif", {0,32,20,32}, {-6,38}); actor::actor_t *hero = actor::create("HERO", {16,32,0}, {6,6,12}, "test.gif", {0,32,20,32}, {-6,38});
hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED; hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
actor::setDirty(hero, true); actor::setDirty(hero, true);

View File

@@ -38,7 +38,7 @@ namespace modules
} }
actor::hero::init(); actor::hero::init();
room::load(1); room::load(0);
} }
void print(int x, int y, int num) void print(int x, int y, int num)
@@ -241,17 +241,17 @@ namespace modules
{ {
actor::actor_t *selected = actor::getSelected(); actor::actor_t *selected = actor::getSelected();
if (!selected) return; if (!selected) return;
if ( input::keyDown(SDL_SCANCODE_LCTRL) || input::keyDown(SDL_SCANCODE_RCTRL) ) return; const int adv = ( input::keyDown(SDL_SCANCODE_LCTRL) || input::keyDown(SDL_SCANCODE_RCTRL) ) ? 8 : 1;
vec3_t min = room::getMin(); vec3_t min = room::getMin();
vec3_t max = room::getMax(); vec3_t max = room::getMax();
if ( input::keyDown(SDL_SCANCODE_LEFT) && selected->pos.x>min.x ) { selected->pos.x--; actor::setDirty(selected); room::editor::modify(); } if ( input::keyDown(SDL_SCANCODE_LEFT) && selected->pos.x>min.x ) { selected->pos.x-=adv; actor::setDirty(selected); room::editor::modify(); }
if ( input::keyDown(SDL_SCANCODE_RIGHT) && (selected->pos.x+selected->size.x)<max.x ) { selected->pos.x++; actor::setDirty(selected); room::editor::modify(); } if ( input::keyDown(SDL_SCANCODE_RIGHT) && (selected->pos.x+selected->size.x)<max.x ) { selected->pos.x+=adv; actor::setDirty(selected); room::editor::modify(); }
if ( input::keyDown(SDL_SCANCODE_UP) && selected->pos.y>min.y ) { selected->pos.y--; actor::setDirty(selected); room::editor::modify(); } if ( input::keyDown(SDL_SCANCODE_UP) && selected->pos.y>min.y ) { selected->pos.y-=adv; actor::setDirty(selected); room::editor::modify(); }
if ( input::keyDown(SDL_SCANCODE_DOWN) && (selected->pos.y+selected->size.y)<max.y ) { selected->pos.y++; actor::setDirty(selected); room::editor::modify(); } if ( input::keyDown(SDL_SCANCODE_DOWN) && (selected->pos.y+selected->size.y)<max.y ) { selected->pos.y+=adv; actor::setDirty(selected); room::editor::modify(); }
if ( input::keyDown(SDL_SCANCODE_PAGEDOWN) && selected->pos.z>min.z ) { selected->pos.z--; actor::setDirty(selected); room::editor::modify(); } if ( input::keyDown(SDL_SCANCODE_PAGEDOWN) && selected->pos.z>min.z ) { selected->pos.z-=adv; actor::setDirty(selected); room::editor::modify(); }
if ( input::keyDown(SDL_SCANCODE_PAGEUP) /*&& selected->pos.z<max.z*/ ) { selected->pos.z++; actor::setDirty(selected); room::editor::modify(); } if ( input::keyDown(SDL_SCANCODE_PAGEUP) /*&& selected->pos.z<max.z*/ ) { selected->pos.z+=adv; actor::setDirty(selected); room::editor::modify(); }
} }
int loop() int loop()
@@ -287,7 +287,7 @@ namespace modules
} }
actor::reorder(); actor::reorder();
if (editor::isEditing()) editor_select_by_keyboard(); //if (editor::isEditing()) editor_select_by_keyboard();
draw::resetViewport(); draw::resetViewport();
draw::cls(2); draw::cls(2);