Different enemies with different properties

This commit is contained in:
2025-03-10 09:23:56 +01:00
parent 95fd58d6dc
commit eed544a9d8
4 changed files with 196 additions and 24 deletions

View File

@ -3,13 +3,16 @@ extends Node2D
@onready var path_2d: Path2D = $Path2D
const FORKMAN = preload("res://Game/Mobs/forkman.tscn")
const SWORDMAN = preload("res://Game/Mobs/swordman.tscn")
const enemies = [FORKMAN, SWORDMAN]
func _on_timer_timeout() -> void:
spawnMonster()
func spawnMonster():
var path = PathFollow2D.new()
var monster = FORKMAN.instantiate()
var monster = enemies.pick_random().instantiate()
path.add_child(monster)
path_2d.add_child(path)