mirror of
https://github.com/mightypanders/GMTKJam2021.git
synced 2025-01-30 21:59:55 +01:00
Moved guests to own node
This commit is contained in:
parent
7ef67351fb
commit
9306f1e18d
4
World.gd
4
World.gd
@ -1,6 +1,7 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
onready var streets = $Streets
|
onready var streets = $Streets
|
||||||
|
onready var guests = $Guests
|
||||||
|
|
||||||
var Guest = load("res://Guest.tscn")
|
var Guest = load("res://Guest.tscn")
|
||||||
|
|
||||||
@ -22,4 +23,5 @@ func _on_GuestTimer_timeout():
|
|||||||
print('new guest at: %s' % [guest_position])
|
print('new guest at: %s' % [guest_position])
|
||||||
var guest = Guest.instance();
|
var guest = Guest.instance();
|
||||||
guest.position = guest_position;
|
guest.position = guest_position;
|
||||||
add_child(guest)
|
guests.add_child(guest)
|
||||||
|
print('Guest count: %s' % [guests.get_child_count()])
|
||||||
|
22
World.tscn
22
World.tscn
@ -222,19 +222,21 @@ position = Vector2( 520.662, 230.739 )
|
|||||||
[node name="DropOffPoint3" parent="." instance=ExtResource( 4 )]
|
[node name="DropOffPoint3" parent="." instance=ExtResource( 4 )]
|
||||||
position = Vector2( 166.312, 322.885 )
|
position = Vector2( 166.312, 322.885 )
|
||||||
|
|
||||||
[node name="Guest" parent="." instance=ExtResource( 5 )]
|
|
||||||
position = Vector2( 337.119, 100.387 )
|
|
||||||
|
|
||||||
[node name="Guest2" parent="." instance=ExtResource( 5 )]
|
|
||||||
position = Vector2( 761.14, 102.634 )
|
|
||||||
|
|
||||||
[node name="Guest3" parent="." instance=ExtResource( 5 )]
|
|
||||||
position = Vector2( 758.143, 376.075 )
|
|
||||||
|
|
||||||
[node name="GuestTimer" type="Timer" parent="."]
|
[node name="GuestTimer" type="Timer" parent="."]
|
||||||
wait_time = 5.0
|
wait_time = 5.0
|
||||||
autostart = true
|
autostart = true
|
||||||
script = ExtResource( 8 )
|
script = ExtResource( 8 )
|
||||||
|
|
||||||
[connection signal="picked_up" from="Guest" to="." method="_on_Guest_picked_up"]
|
[node name="Guests" type="Node" parent="."]
|
||||||
|
|
||||||
|
[node name="Guest" parent="Guests" instance=ExtResource( 5 )]
|
||||||
|
position = Vector2( 337.119, 100.387 )
|
||||||
|
|
||||||
|
[node name="Guest2" parent="Guests" instance=ExtResource( 5 )]
|
||||||
|
position = Vector2( 761.14, 102.634 )
|
||||||
|
|
||||||
|
[node name="Guest3" parent="Guests" instance=ExtResource( 5 )]
|
||||||
|
position = Vector2( 758.143, 376.075 )
|
||||||
|
|
||||||
[connection signal="timeout" from="GuestTimer" to="." method="_on_GuestTimer_timeout"]
|
[connection signal="timeout" from="GuestTimer" to="." method="_on_GuestTimer_timeout"]
|
||||||
|
[connection signal="picked_up" from="Guests/Guest" to="." method="_on_Guest_picked_up"]
|
||||||
|
Loading…
Reference in New Issue
Block a user