add spawning

This commit is contained in:
2024-07-02 23:32:18 +02:00
parent b654df9f35
commit 130a538509
14 changed files with 387 additions and 81 deletions

18
src/NPCs/malegoblin.gd Normal file
View File

@@ -0,0 +1,18 @@
extends KinematicBody2D
const MOVEMENT_VECTORS = [
Vector2.UP,
Vector2.RIGHT,
Vector2.DOWN,
Vector2.LEFT
]
func _physics_process(_delta):
var movement = MOVEMENT_VECTORS[randi() % 4]
move_and_collide(movement * 2)
func _on_Hurtbox_area_entered(_area):
$Hurtbox/death.play()
func _on_death_finished():
queue_free()