From e243d45d2771196675fa44f1723cf2ada2724dc0 Mon Sep 17 00:00:00 2001 From: Conor Edmonds Date: Tue, 9 Jun 2026 19:54:31 -0400 Subject: [PATCH] making a slight edit to make note of what is going on bc i finally figured it out. When a new enemy is spawned in, its initial position is set as 0,0 which gets turned off then. going to try to initialize as -1,-1 and see if that helps --- Enemy.cs | 2 +- Map.cs | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Enemy.cs b/Enemy.cs index d3f5db4..7a236ca 100644 --- a/Enemy.cs +++ b/Enemy.cs @@ -11,7 +11,7 @@ public partial class Enemy : StaticBody2D public delegate void ClickedEventHandler(Enemy THIS); public bool _hovered = false, _track = false; public int _damage = 1, _health = 2, _speed, _speedRemaining, _visibilityRange = 4; - public Vector2I _address, _range = Vector2I.Up; + public Vector2I _address = -Vector2I.One, _range = Vector2I.Up; public List _path = new(); public float _movement = 0; public EnemyController _enemyController; diff --git a/Map.cs b/Map.cs index 6cb1c5d..24c7c9e 100644 --- a/Map.cs +++ b/Map.cs @@ -93,19 +93,11 @@ public partial class Map : TileMapLayer { _addressOccupants[ENEMY._address] = null; SetCellSolid(ENEMY._address); - if (ENEMY._address == Vector2I.Zero) - { - GD.Print(4,_astar.IsPointSolid(ENEMY._address)); - } ENEMY._address = ADDRESS; _addressOccupants[ADDRESS] = ENEMY; SetCellSolid(ADDRESS); - if (ADDRESS == Vector2I.Zero) - { - GD.Print(5,_astar.IsPointSolid(ADDRESS)); - } } public void SetCellSolid(Vector2I ADDRESS)