1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00
Files
godot/demos/2d/dynamic_collision_shapes/dynamic_colobjs.gd
Rémi Verschelde 23cf6a85bd Port 2D demos to TSCN/TRES formats
Part of #4196.
2016-04-02 14:39:08 +02:00

20 lines
345 B
GDScript

extends Node2D
# Member variables
const EMIT_INTERVAL = 0.1
var timeout = EMIT_INTERVAL
func _process(delta):
timeout -= delta
if (timeout < 0):
timeout = EMIT_INTERVAL
var ball = preload("res://ball.tscn").instance()
ball.set_pos(Vector2(randf()*get_viewport_rect().size.x, 0))
add_child(ball)
func _ready():
set_process(true)