From 930b418da6e727e95a45ef3a4b49ddb52d23a072 Mon Sep 17 00:00:00 2001 From: stutxo <70952638+stutxo@users.noreply.github.com> Date: Thu, 28 Mar 2024 02:17:05 +0000 Subject: [PATCH] update names --- src/lib.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7dd19ce..11fea8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -253,19 +253,14 @@ fn update_enemy_pos() { for enemy_entity in ENEMIES.iter_mut() { if let Some(enemy) = enemy_entity { - // Iterate through all WALL to check for collisions. let mut enemy_hit = false; for wall_entity in WALL.iter_mut() { if let Some(wall) = wall_entity { - // Check for overlap in both the X and Y directions. - // Considering the size of the enemy and the wall for collision detection. - if enemy.x < wall.x + WALL_SIZE && enemy.x + ENEMY_SIZE > wall.x && enemy.y < wall.y + WALL_SIZE && enemy.y + ENEMY_SIZE > wall.y { - // Collision detected, remove the wall by setting it to None. *wall_entity = None; enemy_hit = true; }