summaryrefslogtreecommitdiff
path: root/demos/2d/dynamic_collision_shapes/ball.gd
diff options
context:
space:
mode:
Diffstat (limited to 'demos/2d/dynamic_collision_shapes/ball.gd')
-rw-r--r--demos/2d/dynamic_collision_shapes/ball.gd19
1 files changed, 8 insertions, 11 deletions
diff --git a/demos/2d/dynamic_collision_shapes/ball.gd b/demos/2d/dynamic_collision_shapes/ball.gd
index c17b20f9c8..8ffa33f746 100644
--- a/demos/2d/dynamic_collision_shapes/ball.gd
+++ b/demos/2d/dynamic_collision_shapes/ball.gd
@@ -1,21 +1,18 @@
extends RigidBody2D
-# member variables here, example:
-# var a=2
-# var b="textvar"
+# Member variables
+var timeout = 5
-var timeout=5
func _process(delta):
- timeout-=delta
- if (timeout<1):
+ timeout -= delta
+ if (timeout < 1):
set_opacity(timeout)
- if (timeout<0):
+ if (timeout < 0):
queue_free()
-func _ready():
- set_process(true)
- # Initialization here
- pass
+func _ready():
+ # Initialization here
+ set_process(true)