-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameNode.tscn
32 lines (24 loc) · 871 Bytes
/
GameNode.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Ducky.tscn" type="PackedScene" id=1]
[ext_resource path="res://GameCanvas.tscn" type="PackedScene" id=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Node
export (PackedScene) var Ducky
# Called when the node enters the scene tree for the first time.
func _ready():
$Game.get_child(0).show()
$DuckTimer.start()
# Called to add another ducky to the river
func _on_DuckTimer_timeout():
var ducky = Ducky.instance()
var pf = PathFollow2D.new()
pf.add_child(ducky)
$Game/River.add_child(pf)
"
[node name="GameNode" type="Node2D"]
script = SubResource( 1 )
Ducky = ExtResource( 1 )
[node name="Game" parent="." instance=ExtResource( 2 )]
[node name="DuckTimer" type="Timer" parent="."]
wait_time = 2.0
[connection signal="timeout" from="DuckTimer" to="." method="_on_DuckTimer_timeout"]