summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/basketball.gd6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/basketball.gd b/scripts/basketball.gd
index a2f724f..33431f9 100644
--- a/scripts/basketball.gd
+++ b/scripts/basketball.gd
@@ -7,6 +7,7 @@ var waiting_for_shoot = true
var power = 100
var spin_rotation = 0
var spin_speed = -1
+var move_speed = 300
func _ready():
start_position = position
@@ -36,6 +37,11 @@ func _integrate_forces(state):
func _process(delta):
if waiting_for_shoot:
spin_rotation += spin_speed * delta
+ if Input.is_action_pressed("ui_left"):
+ start_position.x -= move_speed * delta
+ if Input.is_action_pressed("ui_right"):
+ start_position.x += move_speed * delta
+ start_position.x = clamp(start_position.x, 0, 1024)
if Input.is_action_pressed("ui_up"):
if power < 200: