aboutsummaryrefslogtreecommitdiffstats
path: root/Enemy0.gd
diff options
context:
space:
mode:
authorfreddie-a <57713959+freddie-a@users.noreply.github.com>2022-10-29 17:43:42 +0100
committerfreddie-a <57713959+freddie-a@users.noreply.github.com>2022-10-29 17:43:42 +0100
commite8204e78a292551bbb363d53411ba959cdc737b4 (patch)
tree9839cde235d31896900cf20f9240ab063d8b0d4d /Enemy0.gd
parent1f7f6c8dc3e55e906ed5f933088c2d1d5fda4923 (diff)
Add homing projectiles
Diffstat (limited to 'Enemy0.gd')
-rw-r--r--Enemy0.gd17
1 files changed, 17 insertions, 0 deletions
diff --git a/Enemy0.gd b/Enemy0.gd
new file mode 100644
index 0000000..ecfb99c
--- /dev/null
+++ b/Enemy0.gd
@@ -0,0 +1,17 @@
+extends KinematicBody2D
+
+
+# Declare member variables here. Examples:
+# var a = 2
+# var b = "text"
+# var player = get_node("")
+onready var globals = get_node("/root/Global")
+
+# 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 _process(delta):
+ move_and_collide(global_position.direction_to(globals.playerPos).normalized() * 2)