- El heroi es independent de la recarrega
This commit is contained in:
@@ -640,13 +640,34 @@ namespace actor
|
||||
|
||||
void clear()
|
||||
{
|
||||
actor_t *hero = nullptr;
|
||||
actor_t *act = first;
|
||||
while (act)
|
||||
{
|
||||
actor_t *tmp = act->next;
|
||||
free(act);
|
||||
if (act->flags & FLAG_HERO) {
|
||||
hero = act;
|
||||
} else {
|
||||
free(act);
|
||||
}
|
||||
act = tmp;
|
||||
}
|
||||
act = dirty;
|
||||
while (act)
|
||||
{
|
||||
actor_t *tmp = act->next;
|
||||
if (act->flags & FLAG_HERO) {
|
||||
hero = act;
|
||||
} else {
|
||||
free(act);
|
||||
}
|
||||
act = tmp;
|
||||
}
|
||||
first = dirty = nullptr;
|
||||
if (hero) {
|
||||
hero->above = hero->below = hero->next = hero->prev = nullptr;
|
||||
dirty = hero;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "jui.h"
|
||||
|
||||
draw::surface *surf;
|
||||
actor::actor_t *box;
|
||||
int room_w = 2;
|
||||
int room_h = 2;
|
||||
int room_xp = -1;
|
||||
@@ -28,15 +27,15 @@ void restart()
|
||||
actor::setDirty(box, true);
|
||||
*/
|
||||
|
||||
box = actor::create("BOX", {32,32,16}, {8,8,8}, {32,0,32,32}, {0,32});
|
||||
actor::actor_t *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);
|
||||
//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();
|
||||
}
|
||||
@@ -49,6 +48,10 @@ void game::init()
|
||||
draw::loadPalette("test.gif");
|
||||
game::setUpdateTicks(64);
|
||||
|
||||
actor::actor_t *hero = actor::create("HERO", {16,32,8}, {8,8,12}, {0,32,20,32}, {-6,38});
|
||||
hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
||||
actor::setDirty(hero, true);
|
||||
|
||||
restart();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user