From: Dominik Kaiser Date: Fri, 10 May 2024 10:17:52 +0000 (+0200) Subject: Make norminette happy X-Git-Url: https://git.dkaiser.de/?a=commitdiff_plain;h=7e992a69a2031f630f1e30b0d864c0e4e7d32067;p=42%2Fso_long.git Make norminette happy --- diff --git a/src/init.c b/src/init.c index d72f486..bd6b48f 100644 --- a/src/init.c +++ b/src/init.c @@ -6,7 +6,7 @@ /* By: dkaiser mlx = mlx_init(1920, 1080, "so_long", false); // TODO: make size and title dynamic game->input_direction = ZERO; init_hooks(game); init_player(&game->player, 960, 540); // TODO: make player spawn point dynamic - mlx_texture_t *texture = mlx_load_png("textures/player.png"); + texture = mlx_load_png("textures/player.png"); game->player.img = mlx_texture_to_image(game->mlx, texture); - mlx_image_to_window(game->mlx, game->player.img, game->player.position.x, game->player.position.y); + mlx_image_to_window(game->mlx, game->player.img, game->player.position.x, + game->player.position.y); return (0); } diff --git a/src/input.c b/src/input.c index 40c5670..a6cb8d4 100644 --- a/src/input.c +++ b/src/input.c @@ -6,17 +6,17 @@ /* 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->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); }