diff options
| author | Dominik Kaiser | 2024-05-15 17:02:29 +0200 |
|---|---|---|
| committer | GitHub | 2024-05-15 17:02:29 +0200 |
| commit | cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7 (patch) | |
| tree | 150075893065fd1e41c8b3a8272e0faee421848e /src/player_process.c | |
| parent | e6edad24c9fa56538d66067dcff6bde39f746239 (diff) | |
| parent | 33a54536567a8b93cd0320814eba4ff515d5277b (diff) | |
| download | so_long-cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7.tar.gz so_long-cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7.zip | |
Merge refactoring into master
Refactoring
Diffstat (limited to 'src/player_process.c')
| -rw-r--r-- | src/player_process.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/player_process.c b/src/player_process.c index 7e27530..c285c4d 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 13:53:01 by dkaiser ### ########.fr */ +/* Updated: 2024/05/15 16:55:29 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,14 +17,15 @@ static t_vector get_direction_from_input(t_game *game); void player_process(t_game *game) { - t_player *player; + t_actor *player; 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)) + if (player->direction.y == -1 && is_on_floor( + (t_collider){player->position, + player->size}, &game->map)) player->velocity.y = -1000; move_and_slide(player, &game->map, game->mlx->delta_time); } |
