summaryrefslogtreecommitdiff
path: root/src/loop.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-05-10 12:17:52 +0200
committerDominik Kaiser2024-05-10 12:17:52 +0200
commit7e992a69a2031f630f1e30b0d864c0e4e7d32067 (patch)
treec3b0ec31cb6c4cb104579c801bbef0678ab99304 /src/loop.c
parentb114117e5f62761dfecd618432a44e75263a929c (diff)
downloadso_long-7e992a69a2031f630f1e30b0d864c0e4e7d32067.tar.gz
so_long-7e992a69a2031f630f1e30b0d864c0e4e7d32067.zip
Make norminette happy
Diffstat (limited to 'src/loop.c')
-rw-r--r--src/loop.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/loop.c b/src/loop.c
index e994bc0..6162935 100644
--- a/src/loop.c
+++ b/src/loop.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/09 15:09:24 by dkaiser #+# #+# */
-/* Updated: 2024/05/10 11:17:33 by dkaiser ### ########.fr */
+/* Updated: 2024/05/10 12:17:03 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,16 +15,14 @@
void loop(void *params)
{
- t_game *game;
+ t_game *game;
- game = (t_game *) params;
+ game = (t_game *)params;
game->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->player.position.y += game->player.direction.y * PLAYER_MOVE_SPEED;
-
- draw(game);
+ game->player.position.x += game->player.direction.x * PLAYER_MOVE_SPEED;
+ game->player.position.y += game->player.direction.y * PLAYER_MOVE_SPEED;
+ draw(game);
}