aboutsummaryrefslogtreecommitdiffstats
path: root/KinematicBody2D.gd
diff options
context:
space:
mode:
Diffstat (limited to 'KinematicBody2D.gd')
-rw-r--r--KinematicBody2D.gd2
1 files changed, 2 insertions, 0 deletions
diff --git a/KinematicBody2D.gd b/KinematicBody2D.gd
index a1a3770..03dd45f 100644
--- a/KinematicBody2D.gd
+++ b/KinematicBody2D.gd
@@ -3,6 +3,7 @@ extends KinematicBody2D
export (int) var speed = 200
var spawn_object = load("res://Bullet.tscn")
var velocity = Vector2()
+onready var globals = get_node("/root/Global")
func get_input():
velocity = Vector2()
@@ -21,6 +22,7 @@ func _physics_process(delta):
get_input()
+ globals.playerPos = global_position
velocity = move_and_slide(velocity)
if Input.is_action_just_pressed("click"):
var obj = spawn_object.instance()