From 300128b8b0eaf4e6dd04c076887721dc645c939e Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Tue, 14 May 2024 12:45:49 +0200 Subject: Outsource player processing and add collision func --- src/loop.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/loop.c') diff --git a/src/loop.c b/src/loop.c index 62b5ed9..c4f95b3 100644 --- a/src/loop.c +++ b/src/loop.c @@ -6,11 +6,10 @@ /* By: dkaiser player.direction.x = ((game->input_direction & RIGHT) != 0) - - ((game->input_direction & LEFT) != 0); - game->player.direction.y = ((game->input_direction & DOWN) != 0) - - ((game->input_direction & UP) != 0); - game->player.position.x += game->player.direction.x * PLAYER_MOVE_SPEED - * game->mlx->delta_time; - game->player.position.y += game->player.direction.y * PLAYER_MOVE_SPEED - * game->mlx->delta_time; + player_process(game); draw(game); } -- cgit v1.2.3