camera dgradatie perongeluk niet bij de vorige commit?

This commit is contained in:
whaffman 2025-05-23 16:06:13 +02:00
parent f75aeb58d8
commit 6c34f24462

View File

@ -6,7 +6,7 @@
/* By: qmennen <qmennen@student.codam.nl> +#+ */ /* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/04/15 15:46:08 by qmennen #+# #+# */ /* Created: 2025/04/15 15:46:08 by qmennen #+# #+# */
/* Updated: 2025/05/23 15:46:03 by whaffman ######## odam.nl */ /* Updated: 2025/05/23 15:58:12 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -50,10 +50,10 @@ void game_loop(void *param)
if (game->framecount % 20 == 0) if (game->framecount % 20 == 0)
{ {
game->fps = (int)(fps / 20); game->fps = (int)(fps / 20);
fprintf(stderr, "FPS: %d\n", fps / 20); fprintf(stderr, "battery: %f FPS: %d\n",game->player->battery, fps / 20);
fps = 0; fps = 0;
} }
player_update(game, delta_time); player_update(game, game->screen->mlx->delta_time);
cast_rays(game); cast_rays(game);
render_map(game); render_map(game);
keyboard_update(game); keyboard_update(game);
@ -62,6 +62,9 @@ void game_loop(void *param)
game->screen->img->instances[0].x = sin(game->framecount / 6.0) * 20; game->screen->img->instances[0].x = sin(game->framecount / 6.0) * 20;
game->screen->img->instances[0].y = cos(game->framecount / 3.0) * 10; game->screen->img->instances[0].y = cos(game->framecount / 3.0) * 10;
} }
game->player->battery -= game->screen->mlx->delta_time / 10;
if (game->player->battery < 0)
game->player->battery = 0.001f;
} }
void game_free(t_game *game) void game_free(t_game *game)