From: Dominik Kaiser Date: Wed, 29 May 2024 11:19:39 +0000 (+0200) Subject: Remove gravity X-Git-Url: https://git.dkaiser.de/?a=commitdiff_plain;h=11df7168d2541e1b3eeeb25dee18ed71ec75d2d2;p=42%2Fso_long.git Remove gravity I'd prefer to have gravity, but unfortunately it would take up to much time to create a checker for the path that would work with it. Definitely not a decision I'm happy about. Will probably revisit that in another project. --- diff --git a/src/player_process.c b/src/player_process.c index 7df0d53..4d78779 100644 --- a/src/player_process.c +++ b/src/player_process.c @@ -6,7 +6,7 @@ /* By: dkaiser player; player->direction = get_direction_from_input(game); player->velocity.x = player->direction.x * PLAYER_MOVE_SPEED; - player->velocity.y += 50; - if (player->direction.y == -1 && is_on_floor((t_collider){player->position, - player->size}, &game->map)) - player->velocity.y = -1000; + player->velocity.y = player->direction.y * PLAYER_MOVE_SPEED; handle_collectible_collision(player, &game->map); handle_exit_collision(player, &game->map); move_and_slide(player, &game->map, game->mlx->delta_time);