summaryrefslogtreecommitdiff
path: root/Basketball.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Basketball.gd')
-rw-r--r--Basketball.gd7
1 files changed, 3 insertions, 4 deletions
diff --git a/Basketball.gd b/Basketball.gd
index d4abf21..1082b2d 100644
--- a/Basketball.gd
+++ b/Basketball.gd
@@ -1,22 +1,21 @@
extends RigidBody2D
var start_position
-
var do_reset = false
# Called when the node enters the scene tree for the first time.
func _ready():
start_position = position
do_reset = true
-
+
# Override the default physics when we want to manually reset the position and rotation.
func _integrate_forces(state):
if do_reset:
state.transform.origin = start_position
state.linear_velocity = Vector2()
+ state.angular_velocity = 0
- apply_central_impulse(Vector2(500, -800))
- apply_torque_impulse(10000.0)
+ apply_impulse(Vector2(10, 10), Vector2(500, -800))
do_reset = false