summaryrefslogtreecommitdiff
path: root/Sprite.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Sprite.gd')
-rw-r--r--Sprite.gd8
1 files changed, 8 insertions, 0 deletions
diff --git a/Sprite.gd b/Sprite.gd
index 1e879c8..ce3a8de 100644
--- a/Sprite.gd
+++ b/Sprite.gd
@@ -5,8 +5,11 @@ export var gravity = 15
var angular_speed = PI
var velocity = Vector2(500, -800)
+var start_position
+
# Called when the node enters the scene tree for the first time.
func _ready():
+ start_position = position
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -16,3 +19,8 @@ func _process(delta):
velocity.y += gravity
+func _input(event):
+ if event.is_action_pressed("shoot"):
+ position = start_position
+ rotation = 0
+ velocity = Vector2(500, -800)