diff options
author | cflip <cflip@cflip.net> | 2022-09-23 09:53:59 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-23 09:53:59 -0600 |
commit | c469ff91edca01c5b8a73b9a9b009ca35bda1ff6 (patch) | |
tree | 575af29e967b24b9b96452235eba1befe108e92a /Sprite.gd | |
parent | 1b585f3d1a6e457436cb245357a36a048a493041 (diff) |
Implement simple basketball physics
Diffstat (limited to 'Sprite.gd')
-rw-r--r-- | Sprite.gd | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1,6 +1,9 @@ extends Sprite +export var gravity = 15 + var angular_speed = PI +var velocity = Vector2(500, -800) # Called when the node enters the scene tree for the first time. func _ready(): @@ -8,5 +11,8 @@ func _ready(): # 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 + |