Improved component system
This commit is contained in:
@ -3,9 +3,12 @@ extends Controller
|
||||
|
||||
var enemy: Enemy
|
||||
|
||||
func _init():
|
||||
name = "Controller"
|
||||
|
||||
func _ready():
|
||||
enemy = owner
|
||||
|
||||
func _process(_delta):
|
||||
var direction := (Global.player.global_position - enemy.global_position).normalized()
|
||||
enemy.set_direction(direction)
|
||||
direction_changed.emit(direction)
|
||||
|
Reference in New Issue
Block a user