2024-06-09 15:51:43 +00:00
|
|
|
extends KinematicBody2D
|
|
|
|
|
|
|
|
|
|
|
|
# Declare member variables here. Examples:
|
|
|
|
# var a = 2
|
|
|
|
# var b = "text"
|
|
|
|
|
|
|
|
const MOVEMENT_VECTORS = [
|
|
|
|
Vector2.UP,
|
|
|
|
Vector2.RIGHT,
|
|
|
|
Vector2.DOWN,
|
|
|
|
Vector2.LEFT
|
|
|
|
]
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
func _physics_process(delta):
|
|
|
|
var movement = MOVEMENT_VECTORS[randi() % 4]
|
|
|
|
move_and_collide(movement * 2)
|
|
|
|
pass
|
2024-06-09 17:22:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_Hitbox_area_entered(area):
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
func _on_Hurtbox_area_entered(area):
|
2024-07-02 11:25:34 +00:00
|
|
|
$Hurtbox/death.play()
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
|
|
|
|
func _on_death_finished():
|
2024-06-09 17:22:49 +00:00
|
|
|
queue_free()
|
|
|
|
pass # Replace with function body.
|