From 5a22961c472d4a36acb94b5fc71b9dc17a318c29 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 24 Sep 2024 11:26:51 +0200 Subject: [PATCH] =?UTF-8?q?NEW]=20Amb=20ALT=20es=20pot=20moure=20un=20acto?= =?UTF-8?q?r=20fora=20dels=20limits=20de=20l'habitaci=C3=B3.=20-=20M=C3=A9?= =?UTF-8?q?s=20habitacions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/rooms/11.txt | 44 +++++++++++++ data/rooms/12.txt | 155 +++++++++++++++++++++++++++++++++++++++++++-- data/rooms/15.txt | 25 ++++++-- data/rooms/16.txt | 19 ++++-- data/templates.txt | 11 ++++ source/m_game.cpp | 35 ++++++++-- 6 files changed, 267 insertions(+), 22 deletions(-) diff --git a/data/rooms/11.txt b/data/rooms/11.txt index 9cdb22e..d85ed3d 100644 --- a/data/rooms/11.txt +++ b/data/rooms/11.txt @@ -8,6 +8,50 @@ door-texture: 1 under-door-texture: 0 exit-yp: 10 +actor{ + name: FINESTRA-00 + bmp: altres.gif + bmp-rect: 0 75 20 33 + bmp-offset: 0 39 + pos: -1 36 4 + size: 1 1 9 + movement: CW +} + +actor{ + name: FINESTRA-01 + bmp: altres.gif + bmp-rect: 0 75 20 33 + bmp-offset: 0 39 + pos: -1 44 4 + size: 1 1 9 + movement: CW +} + +actor{ + name: FINESTRA-02 + bmp: altres.gif + bmp-rect: 0 75 20 33 + bmp-offset: 0 39 + pos: 48 2 5 + size: 1 1 9 + orient: YP + flags: ORIENTABLE + movement: CW +} + +actor{ + name: FINESTRA-03 + bmp: altres.gif + bmp-rect: 0 75 20 33 + bmp-offset: 0 39 + pos: 40 2 5 + size: 1 1 9 + orient: YP + flags: ORIENTABLE + movement: CW +} + actor{ name: GAT-BATMAN bmp: gat.gif diff --git a/data/rooms/12.txt b/data/rooms/12.txt index 891a54d..74602d0 100644 --- a/data/rooms/12.txt +++ b/data/rooms/12.txt @@ -1,13 +1,158 @@ -width: 2 -height: 2 -door-height-xp: 0 -door-height-xn: 0 +width: 3 +height: 1 +door-height-xp: 5 +door-height-xn: 5 door-height-yn: 0 color: GREEN -floor-texture: 3 +floor-texture: 0 wall-texture: 3 door-texture: 1 under-door-texture: 3 exit-xp: 13 exit-xn: 9 exit-yn: 15 + +actor{ + name: ABAD + bmp: abad.gif + bmp-rect: 0 0 20 33 + bmp-offset: -6 38 + pos: 0 40 0 + size: 8 8 8 + orient: XP + anim-wait: 1 + flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY + react-mask: XP XN YP YN ZP ZN + movement: X +} + +actor{ + name: BATMAN + bmp: batman.gif + bmp-rect: 0 0 21 32 + bmp-offset: -5 35 + pos: 56 40 0 + size: 8 8 8 + orient: XN + anim-wait: 1 + flags: REACTIVE MOVING ANIMATED ORIENTABLE DEADLY + react-mask: XP XN YP YN ZP ZN + movement: X +} + +actor{ + name: BOX-A-00 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 0 24 16 + size: 8 8 4 + movement: CW +} + +actor{ + name: BOX-A-01 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 8 28 16 + size: 8 8 4 + flags: PUSHABLE + movement: CW +} + +actor{ + name: BOX-A-02 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 16 28 16 + size: 8 8 4 + flags: PUSHABLE + movement: CW +} + +actor{ + name: BOX-A-03 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 24 28 16 + size: 8 8 4 + flags: PUSHABLE + movement: CW +} + +actor{ + name: BOX-A-04 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 32 28 16 + size: 8 8 4 + flags: DISAPPEAR + movement: CW +} + +actor{ + name: BOX-A-05 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 40 28 16 + size: 8 8 4 + flags: PUSHABLE + movement: CW +} + +actor{ + name: BOX-A-06 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 48 28 16 + size: 8 8 4 + flags: PUSHABLE + movement: CW +} + +actor{ + name: BOX-A-07 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 56 24 16 + size: 8 8 4 + movement: CW +} + +actor{ + name: BOX-A-08 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 0 32 16 + size: 8 8 4 + movement: CW +} + +actor{ + name: BOX-A-09 + bmp: caixes.gif + bmp-rect: 160 128 32 32 + bmp-offset: 0 32 + pos: 56 32 16 + size: 8 8 4 + movement: CW +} + +actor{ + name: PILOTA + bmp: altres.gif + bmp-rect: 0 108 21 21 + bmp-offset: -6 26 + pos: 40 40 0 + size: 8 8 8 + flags: PUSHABLE INERTIA + movement: CW +} diff --git a/data/rooms/15.txt b/data/rooms/15.txt index b3f83f0..59eab8c 100644 --- a/data/rooms/15.txt +++ b/data/rooms/15.txt @@ -1,13 +1,24 @@ -width: 2 -height: 2 +width: 1 +height: 3 door-height-xp: 0 door-height-yp: 0 -door-height-yn: 0 +door-height-yn: 3 color: YELLOW -floor-texture: 0 -wall-texture: 0 -door-texture: 0 -under-door-texture: 0 +floor-texture: 6 +wall-texture: 3 +door-texture: 1 +under-door-texture: 3 exit-xp: 14 exit-yp: 12 exit-yn: 16 + +actor{ + name: PILOTA + bmp: altres.gif + bmp-rect: 0 108 21 21 + bmp-offset: -6 26 + pos: 24 32 0 + size: 8 8 8 + flags: PUSHABLE INERTIA + movement: CW +} diff --git a/data/rooms/16.txt b/data/rooms/16.txt index 1e2bb38..9eab672 100644 --- a/data/rooms/16.txt +++ b/data/rooms/16.txt @@ -2,14 +2,14 @@ width: 3 height: 1 door-height-yp: 0 color: PURPLE -floor-texture: 0 -wall-texture: 0 -door-texture: 0 +floor-texture: 4 +wall-texture: 1 +door-texture: 2 under-door-texture: 0 exit-yp: 15 actor{ - name: BOX-A + name: BOX-A-00 bmp: caixes.gif bmp-rect: 0 0 32 32 bmp-offset: 0 32 @@ -19,6 +19,17 @@ actor{ movement: CW } +actor{ + name: BOX-A-01 + bmp: caixes.gif + bmp-rect: 0 0 32 32 + bmp-offset: 0 32 + pos: 0 40 0 + size: 8 8 8 + flags: PUSHABLE + movement: CW +} + actor{ name: BOX-B bmp: caixes.gif diff --git a/data/templates.txt b/data/templates.txt index e96be8b..2b0a0f0 100644 --- a/data/templates.txt +++ b/data/templates.txt @@ -152,6 +152,17 @@ category{ movement: CW } + actor{ + name: PILOTA + bmp: altres.gif + bmp-rect: 0 108 21 21 + bmp-offset: -6 26 + pos: 24 32 0 + size: 8 8 8 + flags: PUSHABLE INERTIA + movement: CW + } + } category{ diff --git a/source/m_game.cpp b/source/m_game.cpp index a89b91f..b5d638c 100644 --- a/source/m_game.cpp +++ b/source/m_game.cpp @@ -244,12 +244,35 @@ namespace modules vec3_t min = room::getMin(); vec3_t max = room::getMax(); - 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(); } + if ( input::keyDown(SDL_SCANCODE_LEFT) && (input::keyDown(SDL_SCANCODE_LALT) || selected->pos.x>min.x )) + { + selected->pos.x-=adv; actor::setDirty(selected); room::editor::modify(); + } + + if ( input::keyDown(SDL_SCANCODE_RIGHT) && (input::keyDown(SDL_SCANCODE_LALT) || (selected->pos.x+selected->size.x)pos.x+=adv; actor::setDirty(selected); room::editor::modify(); + } + + if ( input::keyDown(SDL_SCANCODE_UP) && (input::keyDown(SDL_SCANCODE_LALT) || selected->pos.y>min.y )) + { + selected->pos.y-=adv; actor::setDirty(selected); room::editor::modify(); + } + + if ( input::keyDown(SDL_SCANCODE_DOWN) && (input::keyDown(SDL_SCANCODE_LALT) || (selected->pos.y+selected->size.y)pos.y+=adv; actor::setDirty(selected); room::editor::modify(); + } + + if ( input::keyDown(SDL_SCANCODE_PAGEDOWN) && (input::keyDown(SDL_SCANCODE_LALT) || 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()