Update spawner to not spawn where the player is going to be

This commit is contained in:
ultrablob 2025-02-09 09:46:35 -05:00
parent 4945aeb799
commit dbac0cbd65
2 changed files with 4 additions and 11 deletions

View file

@ -62,6 +62,8 @@ func spawn(item: WaveEnemy):
var test_pos = Vector2(randf(), randf()) * Vector2(1920, 1080)
if not $"../CollisionCheck".is_clear(test_pos, item.check_distance):
continue
if Geometry2D.segment_intersects_circle($"../Player".global_position, $"../Player".global_position + $"../Player".linear_velocity, test_pos, 250) != -1:
continue
spawn_loc = test_pos
break