diff --git a/data/rooms/00.txt b/data/rooms/00.txt index 60400b2..fc72eb6 100644 --- a/data/rooms/00.txt +++ b/data/rooms/00.txt @@ -38,16 +38,6 @@ actor{ 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: LLIT bmp: altres.gif @@ -77,3 +67,95 @@ actor{ size: 6 4 2 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 +} diff --git a/data/rooms/02.txt b/data/rooms/02.txt index d430dc7..52c0631 100644 --- a/data/rooms/02.txt +++ b/data/rooms/02.txt @@ -11,7 +11,17 @@ exit-xn: 1 exit-yn: 3 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-rect: 64 32 24 32 bmp-offset: -8 36 @@ -21,30 +31,7 @@ actor{ } actor{ - name: KALLAX-A - 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 + name: ARMARI-A1 bmp: caixes.gif bmp-rect: 64 32 24 32 bmp-offset: -8 36 @@ -54,7 +41,52 @@ 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-rect: 96 32 24 32 bmp-offset: -8 36 @@ -64,7 +96,7 @@ actor{ } actor{ - name: BOX01 + name: ARMARI-A2 bmp: caixes.gif bmp-rect: 96 32 24 32 bmp-offset: -8 36 @@ -74,17 +106,7 @@ actor{ } actor{ - name: KALLAX-A01 - 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 + name: PILOTA bmp: altres.gif bmp-rect: 0 108 22 22 bmp-offset: -5 24 @@ -115,6 +137,19 @@ actor{ 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{ name: BOOSTER bmp: objectes.gif @@ -127,15 +162,3 @@ actor{ flags: ANIMATED SPECIAL 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 -} diff --git a/data/rooms/03.txt b/data/rooms/03.txt index 02c9969..aeb17d2 100644 --- a/data/rooms/03.txt +++ b/data/rooms/03.txt @@ -1,5 +1,5 @@ width: 2 -height: 3 +height: 2 door-height-xn: 0 door-height-yp: 0 color: CYAN @@ -9,3 +9,135 @@ door-texture: 0 under-door-texture: 0 exit-xn: 4 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 +} diff --git a/data/rooms/04.txt b/data/rooms/04.txt index 42f03ea..e1cd09a 100644 --- a/data/rooms/04.txt +++ b/data/rooms/04.txt @@ -1,11 +1,86 @@ -width: 2 -height: 2 +width: 3 +height: 1 door-height-xp: 0 door-height-xn: 0 -color: CYAN -floor-texture: 0 -wall-texture: 0 -door-texture: 0 -under-door-texture: 0 +color: WHITE +floor-texture: 1 +wall-texture: 6 +door-texture: 6 +under-door-texture: 6 exit-xp: 3 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 +} diff --git a/data/rooms/05.txt b/data/rooms/05.txt index fe752f4..0a8c9c7 100644 --- a/data/rooms/05.txt +++ b/data/rooms/05.txt @@ -8,15 +8,29 @@ door-texture: 0 under-door-texture: 0 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{ name: GAT-NEGRE bmp: gat.gif bmp-rect: 0 0 24 28 bmp-offset: -4 32 - pos: 8 8 0 + pos: 32 32 2 size: 8 8 8 orient: XP anim-wait: 2 - flags: MOVING ANIMATED ORIENTABLE + flags: PUSHABLE REACTIVE DEADLY GRAVITY + react-mask: XP XN YP YN ZP ZN movement: CCW } diff --git a/data/templates.txt b/data/templates.txt index 230b366..9b6834f 100644 --- a/data/templates.txt +++ b/data/templates.txt @@ -1,11 +1,12 @@ actor{ name: BOX - bmp: test.gif + bmp: caixes.gif bmp-rect: 32 0 32 32 bmp-offset: 0 32 pos: 32 32 0 size: 8 8 8 + flags: PUSHABLE movement: CW } @@ -260,9 +261,20 @@ actor{ bmp: caixes.gif bmp-rect: 160 0 32 32 bmp-offset: 0 34 - pos: 56 24 0 + pos: 32 32 0 size: 8 8 2 orient: XN - flags: MOVING + flags: REACTIVE MOVING DEADLY + react-mask: XP XN YP YN ZP ZN 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 +} diff --git a/source/actor.cpp b/source/actor.cpp index 9246aa4..b29b3f0 100644 --- a/source/actor.cpp +++ b/source/actor.cpp @@ -1353,7 +1353,7 @@ namespace actor 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; actor::setDirty(hero, true); diff --git a/source/m_game.cpp b/source/m_game.cpp index cbf1111..bfdd9df 100644 --- a/source/m_game.cpp +++ b/source/m_game.cpp @@ -38,7 +38,7 @@ namespace modules } actor::hero::init(); - room::load(1); + room::load(0); } void print(int x, int y, int num) @@ -241,17 +241,17 @@ namespace modules { actor::actor_t *selected = actor::getSelected(); 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 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_RIGHT) && (selected->pos.x+selected->size.x)pos.x++; 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_DOWN) && (selected->pos.y+selected->size.y)pos.y++; 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_PAGEUP) /*&& selected->pos.zpos.z++; 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)pos.x+=adv; 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)pos.y+=adv; 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.zpos.z+=adv; actor::setDirty(selected); room::editor::modify(); } } int loop() @@ -287,7 +287,7 @@ namespace modules } actor::reorder(); - if (editor::isEditing()) editor_select_by_keyboard(); + //if (editor::isEditing()) editor_select_by_keyboard(); draw::resetViewport(); draw::cls(2);