multi key action
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user