summaryrefslogtreecommitdiff
path: root/src/loop.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-05-10 12:01:25 +0200
committerDominik Kaiser2024-05-10 12:01:25 +0200
commit546c596505ded408bd0a73343618b100013d310f (patch)
tree536765943fc7d0426fc54c08792a9572309ee7e2 /src/loop.c
parent699a39ad492c6e7c5b7048378819d2ca8a98581f (diff)
downloadso_long-546c596505ded408bd0a73343618b100013d310f.tar.gz
so_long-546c596505ded408bd0a73343618b100013d310f.zip
Replicate main functionality in MLX42
Diffstat (limited to 'src/loop.c')
-rw-r--r--src/loop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/loop.c b/src/loop.c
index 69c0712..e994bc0 100644
--- a/src/loop.c
+++ b/src/loop.c
@@ -6,16 +6,18 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/09 15:09:24 by dkaiser #+# #+# */
-/* Updated: 2024/05/10 10:53:59 by dkaiser ### ########.fr */
+/* Updated: 2024/05/10 11:17:33 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include "so_long.h"
-int loop(t_game *game)
+void loop(void *params)
{
+ t_game *game;
+ 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)
@@ -25,5 +27,4 @@ int loop(t_game *game)
game->player.position.y += game->player.direction.y * PLAYER_MOVE_SPEED;
draw(game);
- return (0);
}