diff options
Diffstat (limited to 'src/player_process.c')
| -rw-r--r-- | src/player_process.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/player_process.c b/src/player_process.c index c66d13d..0194d59 100644 --- a/src/player_process.c +++ b/src/player_process.c @@ -6,7 +6,7 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/14 12:40:05 by dkaiser #+# #+# */ -/* Updated: 2024/05/15 14:46:26 by dkaiser ### ########.fr */ +/* Updated: 2024/05/15 15:04:25 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,14 +17,16 @@ static t_vector get_direction_from_input(t_game *game); void player_process(t_game *game) { - t_actor *player; + t_actor *player; + t_collider c; player = &game->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(player->position, player->size, - &game->map)) + c.position = player->position; + c.size = player->size; + if (player->direction.y == -1 && is_on_floor(c, &game->map)) player->velocity.y = -1000; move_and_slide(player, &game->map, game->mlx->delta_time); } |
