From 1fd6fa43ab51187441b6447a4522aba0d96c7dfb Mon Sep 17 00:00:00 2001 From: CalisJI Date: Wed, 21 Aug 2024 16:37:46 +0700 Subject: [PATCH] Update --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b5d7728..00776a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -150,7 +150,11 @@ void updateEnemies() enemy.y += 1; // Move downwards if (enemy.y > SCREEN_HEIGHT) { - enemy.y = 0; // Reset position if off screen + for (int i = 0; i < NUM_ENEMIES; ++i) + { + enemies[i] = {i * (SCREEN_WIDTH / NUM_ENEMIES) + 7, 0, true}; + } + //enemy.y = 0; // Reset position if off screen } } }