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

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

View File

@@ -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)<max.x ) { selected->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)<max.y ) { selected->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.z<max.z*/ ) { selected->pos.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)<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-=adv; 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-=adv; 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()
@@ -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);