summaryrefslogtreecommitdiff
path: root/scripts/wave_spawner.gd
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-05-22 21:10:02 -0400
committerbd <bdunahu@operationnull.com>2025-05-22 21:10:02 -0400
commit5af13cd2c4e87c6e273d4c8d84c06cd6a320b427 (patch)
tree0e55a3c0c823481106c8c553fee9510eaa734305 /scripts/wave_spawner.gd
parenta95e2ead7e3ade3c13e4e9f6e68c24df4430097a (diff)
Make resource file for common map variables
Diffstat (limited to 'scripts/wave_spawner.gd')
-rw-r--r--scripts/wave_spawner.gd3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/wave_spawner.gd b/scripts/wave_spawner.gd
index 3f63c71..7c54dfc 100644
--- a/scripts/wave_spawner.gd
+++ b/scripts/wave_spawner.gd
@@ -1,5 +1,6 @@
extends Node2D
+@onready var map_config = preload("res://resources/map_generator_resource.tres")
@onready var fodder_enemy = preload("res://scenes/soldier.tscn")
@onready var map = get_node("../Map")
@@ -16,7 +17,7 @@ func _ready() -> void:
# adjust to grid size
for i in map.get_enemy_path():
- curve.add_point(i * 16 + Vector2i.ONE * 8)
+ curve.add_point(i * map_config.tile_size + Vector2i.ONE * (map_config.tile_size / 2))
func _on_timer_timeout():
var path = Path2D.new()