diff options
author | cflip <cflip@cflip.net> | 2022-09-23 17:23:06 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-23 17:23:06 -0600 |
commit | ed3b37f6fa7b37429f79a7d229e1134ae316ed7e (patch) | |
tree | e8424d06ac364327c32e18899bc7d837d042bb66 /Sprite.gd | |
parent | c46bb2fca39de21df9c4abbdc9cbbf2262e8ace0 (diff) |
Replace the basketball sprite object with a RigidBody2D
This way we don't have to implement all of the physics ourselves.
Diffstat (limited to 'Sprite.gd')
-rw-r--r-- | Sprite.gd | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Sprite.gd b/Sprite.gd deleted file mode 100644 index ce3a8de..0000000 --- a/Sprite.gd +++ /dev/null @@ -1,26 +0,0 @@ -extends Sprite - -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. -func _process(delta): - position += velocity * delta - rotation += angular_speed * delta - - velocity.y += gravity - -func _input(event): - if event.is_action_pressed("shoot"): - position = start_position - rotation = 0 - velocity = Vector2(500, -800) |