- Afegit nom als actors

- [BUG] Els actors es movien magicament (push no definit)
- Clear de actors
- Comencem amb l'editor
This commit is contained in:
2023-06-04 11:37:27 +02:00
parent 5ee23cb000
commit 312bed64da
5 changed files with 57 additions and 28 deletions

View File

@@ -7,6 +7,31 @@
draw::surface *surf;
actor::actor_t *box;
int ii = 0;
void restart()
{
actor::clear();
room::load(ii,3);
box = actor::create("ASCENSOR",{16,32,0}, {8,8,4}, {64,0,32,24}, {0,24});
box->flags = FLAG_MOVING;
box->movement = MOV_Z;
box->mov_push = PUSH_ZP;
actor::setDirty(box, true);
box = actor::create("BOX", {32,32,16}, {8,8,8}, {32,0,32,32}, {0,32});
box->flags = FLAG_PUSHABLE | FLAG_GRAVITY;
box->movement = MOV_CW;
box->mov_push = PUSH_XN;
actor::setDirty(box, true);
box = actor::create("HERO", {16,32,8}, {8,8,12}, {0,32,20,32}, {-6,38});
box->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
actor::setDirty(box, true);
actor::reorder();
}
void game::init()
{
@@ -16,25 +41,7 @@ void game::init()
draw::loadPalette("test.gif");
game::setUpdateTicks(64);
room::load(3,3);
box = actor::create({16,32,0}, {8,8,4}, {64,0,32,24}, {0,24});
box->flags = FLAG_MOVING;
box->movement = MOV_Z;
box->mov_push = PUSH_ZP;
actor::setDirty(box, true);
box = actor::create({32,32,16}, {8,8,8}, {32,0,32,32}, {0,32});
box->flags = FLAG_PUSHABLE | FLAG_GRAVITY;
box->movement = MOV_CW;
box->mov_push = PUSH_XN;
actor::setDirty(box, true);
box = actor::create({16,32,8}, {8,8,12}, {0,32,20,32}, {-6,38});
box->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
actor::setDirty(box, true);
actor::reorder();
restart();
}
int sx=1, sy=0;
@@ -42,6 +49,11 @@ int sx=1, sy=0;
bool game::loop()
{
if ( input::keyDown(SDL_SCANCODE_Q) )
{
ii++;if(ii>3)ii=0;
restart();
}
actor::update(actor::getFirst());
actor::reorder();