add player moves and test image

This commit is contained in:
Hugo LAMY
2022-03-30 12:55:39 +02:00
parent f645da7885
commit 08f7b89d82
10 changed files with 109 additions and 223 deletions

View File

@@ -6,14 +6,12 @@ void keypress_do_action(t_game *game)
if (is_esc(game->k_hook))
shut_down(game);
if (is_go_left(game->k_hook))
(game->plr_x) -= 5;
plr_posx_decrement(game);
if (is_go_right(game->k_hook))
(game->plr_x) += 5;
plr_posx_increment(game);
if (is_go_forward(game->k_hook))
(game->plr_y) -= 5;
plr_posy_decrement(game);
if (is_go_backward(game->k_hook))
(game->plr_y) += 5;
plr_posy_increment(game);
draw(game);
}