multi key action

This commit is contained in:
hugogogo
2022-03-23 14:36:20 +01:00
parent 95bd304708
commit f37f2891a4
4 changed files with 89 additions and 21 deletions

View File

@@ -7,3 +7,21 @@ int shut_down(t_game *game)
free(game);
return (0);
}
// temp, to test keypress hook
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;
if (is_go_right(game->k_hook))
(game->plr_x) += 5;
if (is_go_forward(game->k_hook))
(game->plr_y) -= 5;
if (is_go_backward(game->k_hook))
(game->plr_y) += 5;
mlx_pixel_put(game->mlx_ptr, game->win_ptr, game->plr_x, game->plr_y, 0x74db74);
}