-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathChoosePlayer.tscn
66 lines (48 loc) · 1.53 KB
/
ChoosePlayer.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[gd_scene load_steps=3 format=2]
[ext_resource path="res://PlayerSprites.tscn" type="PackedScene" id=1]
[sub_resource type="GDScript" id=1]
script/source = "extends Button
signal playerisabird
onready var animator = get_node(\"Sprite/AnimationPlayer\")
var isabird
func init():
isabird = utils.config.get_value(\"player\", \"isabird\")
if isabird: animator.play(\"birdFly_choosePlayer\")
else: animator.play(\"trexAnimRun_choosePlayer\")
func _ready():
init()
func _on_ChoosePlayer_pressed():
# print(\"foo\", isabird)
isabird = not isabird
emit_signal(\"playerisabird\", isabird)
utils.config.set_value(\"player\", \"isabird\", isabird)
utils.config.save(utils.CONFIG_PATH)
init()
func _on_ChoosePlayer_visibility_changed():
init()
"
[node name="ChoosePlayer" type="Button"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 62.0
margin_bottom = 60.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
flat = false
script = SubResource( 1 )
_sections_unfolded = [ "Rect" ]
[node name="Sprite" parent="." instance=ExtResource( 1 )]
position = Vector2( 0.88591, 29.8999 )
centered = false
[connection signal="pressed" from="." to="." method="_on_ChoosePlayer_pressed"]
[connection signal="toggled" from="." to="." method="_on_ChoosePlayer_toggled"]
[connection signal="visibility_changed" from="." to="." method="_on_ChoosePlayer_visibility_changed"]