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)})