Moved player_set_vars to player_step, thanks KBD2.

This commit is contained in:
KikooDX 2021-01-15 13:52:29 +01:00
parent cfeb0a423a
commit 96d3472404
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,6 @@ void player_set_vars(Player *player, const Level *level) {
}
void player_move(Player *player, const Level *level) {
player_set_vars(player, level);
/* TODO: Take into account player's hitbox */
const int sgn_spd_x = SGN(player->spd.x);
const int sgn_spd_y = SGN(player->spd.y);
@ -121,6 +120,7 @@ void player_move(Player *player, const Level *level) {
}
void player_step(Player *player, Input *input, const Level *level, uint step) {
player_set_vars(player, level);
/* Get directionnal input and assign it to move.x/move.y:
* i.e., if the player hold left and down move will have
* move.x = -1 and move.y = 1. */