|
|
@ -29,6 +29,7 @@ void actor_init(void) { |
|
|
|
actor_reset(); |
|
|
|
|
|
|
|
PLAYER_ACTOR->active = 1; |
|
|
|
PLAYER_ACTOR->flip = 0; |
|
|
|
PLAYER_ACTOR->anim = ANIM_STAND; |
|
|
|
PLAYER_ACTOR->frame_idx = 0; |
|
|
|
PLAYER_ACTOR->frame_counter = 0; |
|
|
@ -60,6 +61,7 @@ actor_t *actor_create_mob(uint8_t id) { |
|
|
|
|
|
|
|
a = &all_actors[i]; |
|
|
|
a->active = 1; |
|
|
|
a->flip = 0; |
|
|
|
a->mob_anim_idx = mob_anim_idx; |
|
|
|
a->anim = ANIM_STAND; |
|
|
|
a->frame_idx = 0; |
|
|
@ -99,26 +101,26 @@ void actor_update(void) { |
|
|
|
|
|
|
|
oam_ptr->y = a->y + 16; |
|
|
|
oam_ptr->x = a->x + 8; |
|
|
|
oam_ptr->tile = *anim_ptr++ + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = 0; |
|
|
|
oam_ptr->tile = anim_ptr[a->flip] + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = a->flip ? (1 << 5) : 0; |
|
|
|
oam_ptr++; |
|
|
|
|
|
|
|
oam_ptr->y = a->y + 16; |
|
|
|
oam_ptr->x = a->x + TILE_WIDTH + 8; |
|
|
|
oam_ptr->tile = *anim_ptr++ + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = 0; |
|
|
|
oam_ptr->tile = anim_ptr[1 - a->flip] + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = a->flip ? (1 << 5) : 0; |
|
|
|
oam_ptr++; |
|
|
|
|
|
|
|
oam_ptr->y = a->y + TILE_WIDTH + 16; |
|
|
|
oam_ptr->x = a->x + 8; |
|
|
|
oam_ptr->tile = *anim_ptr++ + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = 0; |
|
|
|
oam_ptr->tile = anim_ptr[a->flip + 2] + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = a->flip ? (1 << 5) : 0; |
|
|
|
oam_ptr++; |
|
|
|
|
|
|
|
oam_ptr->y = a->y + TILE_WIDTH + 16; |
|
|
|
oam_ptr->x = a->x + TILE_WIDTH + 8; |
|
|
|
oam_ptr->tile = *anim_ptr++ + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = 0; |
|
|
|
oam_ptr->tile = anim_ptr[1 - a->flip + 2] + TILE_INDEX_PLAYER; |
|
|
|
oam_ptr->attr = a->flip ? (1 << 5) : 0; |
|
|
|
oam_ptr++; |
|
|
|
|
|
|
|
a++; |
|
|
|