From e7fab3bfc3232c48c2c810a71a277a89f8ad9b55 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Sat, 31 May 2025 18:28:59 +0200 Subject: [PATCH] Fall faster fruits --- src/level.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/level.hpp b/src/level.hpp index 2e71aaf..c76238d 100644 --- a/src/level.hpp +++ b/src/level.hpp @@ -53,16 +53,15 @@ struct LevelModule Game const& game, TextureAssets const& texture_assets) { - if ((game.ticks % 100) == 0) + if ((game.ticks % 40) == 0) { auto fruit = it.world() .entity() .add() .add() - .set(Position{ - .x = static_cast(game.ticks % WINDOW_WIDTH), .y = -16}) - .set(Velocity{.x = 0, .y = 1}) + .set(Position{.x = std::rand() % WINDOW_WIDTH, .y = -16}) + .set(Velocity{.x = 0, .y = 2}) .set(Sprite{.texture = &texture_assets.fruits, .texture_atlas_index = static_cast(game.ticks % 228)})