usage of enums for frames
This commit is contained in:
@@ -8,17 +8,17 @@ PlayerPosition get_aligned_frame_position(PlayerPosition base, int frame_index)
|
||||
if (frame_index < 0 || frame_index >= PLAYER_FRAME_COUNT)
|
||||
frame_index = 0;
|
||||
|
||||
int sprite_height = 0;
|
||||
int character_height = 0;
|
||||
if (frame_index == 0)
|
||||
sprite_height = PLAYER_MASK_LINES_FRAME_1;
|
||||
character_height = PLAYER_MASK_LINES_FRAME_1;
|
||||
else if (frame_index == 1)
|
||||
sprite_height = PLAYER_MASK_LINES_FRAME_2;
|
||||
character_height = PLAYER_MASK_LINES_FRAME_2;
|
||||
else
|
||||
sprite_height = PLAYER_MASK_LINES_FRAME_3;
|
||||
character_height = PLAYER_MASK_LINES_FRAME_3;
|
||||
|
||||
PlayerPosition draw_pos;
|
||||
draw_pos.x = base.x;
|
||||
draw_pos.y = (VIEW_HEIGHT - base.y) - sprite_height;
|
||||
draw_pos.y = (VIEW_HEIGHT - base.y) - character_height;
|
||||
|
||||
return draw_pos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user