Background character and enemy

This commit is contained in:
2024-10-26 11:32:56 +02:00
parent 706c85338a
commit f55a15e24e
89 changed files with 1616 additions and 0 deletions

8
scripts/enemy.gd Normal file
View File

@ -0,0 +1,8 @@
extends CharacterBody2D
@onready var player = get_node("/root/Game/player")
func _physics_process(delta: float) -> void:
var direction = global_position.direction_to(player.global_position)
velocity = direction * 50
move_and_slide()