summaryrefslogtreecommitdiff
path: root/Basketball.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Basketball.gd')
-rw-r--r--Basketball.gd20
1 files changed, 20 insertions, 0 deletions
diff --git a/Basketball.gd b/Basketball.gd
new file mode 100644
index 0000000..31642ae
--- /dev/null
+++ b/Basketball.gd
@@ -0,0 +1,20 @@
+extends RigidBody2D
+
+var angular_speed = PI
+var start_position
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ start_position = position
+ apply_central_impulse(Vector2(500, -800))
+ pass # Replace with function body.
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta):
+ rotation += angular_speed * delta
+
+func _input(event):
+ if event.is_action_pressed("shoot"):
+ position = start_position
+ rotation = 0
+ apply_central_impulse(Vector2(500, -800))