-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.tscn
More file actions
246 lines (203 loc) · 6.23 KB
/
root.tscn
File metadata and controls
246 lines (203 loc) · 6.23 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[gd_scene load_steps=9 format=2]
[ext_resource path="res://success.wav" type="AudioStream" id=1]
[ext_resource path="res://fail.wav" type="AudioStream" id=2]
[ext_resource path="res://Smile/Smile.tscn" type="PackedScene" id=3]
[ext_resource path="res://Task/Task.tscn" type="PackedScene" id=4]
[ext_resource path="res://Task/next_task.png" type="Texture" id=5]
[ext_resource path="res://Task/next_task_disabled.png" type="Texture" id=6]
[ext_resource path="res://Abaco/abaco.tscn" type="PackedScene" id=7]
[sub_resource type="GDScript" id=1]
script/source = "extends Node2D
# class member variables go here, for example:
# var a = 2
# var b = \"textvar\"
var taskNode = null
var nextTaskButton = null
var smileNode = null
var abacoNode = null
func _ready():
taskNode = get_node(\"margin/VBox/HBox/Task\")
smileNode = get_node(\"margin/VBox/HBox/Smile\")
abacoNode = get_node(\"margin/VBox/Abaco\")
nextTaskButton = get_node(\"margin/VBox/HBox/VBox/NextTaskButton\")
# taskNode.load_tasks(\"res://tasks.txt\")
nextTaskButton.disabled = true
smileNode.set_jolly()
func _process(delta):
# Called every frame. Delta is time since last frame.
# Update game logic here.
# $minion.position.x +=5
pass
func _on_Task_answer_correct(task):
nextTaskButton.disabled = false
get_node(\"success\").play(0.0)
var operator = task.operator
var operand1 = int(task.operand1)
var operand2 = int(task.operand2)
var result = int(task.result)
var blue = operand1
var red = operand2
if(operator == '-'):
if(operand1 == operand2):
blue = 0
red = 0
else:
blue = operand1 - operand2
red = operand2
abacoNode.set_abaco_state(blue, red)
smileNode.set_jolly()
func _on_Task_answer_wrong(task):
get_node(\"wrong\").play(0.0)
smileNode.set_sad()
func _on_next_task():
taskNode.set_next_task()
nextTaskButton.disabled = true
abacoNode.reset()
"
[node name="root" type="Node2D" index="0"]
script = SubResource( 1 )
_sections_unfolded = [ "Transform" ]
[node name="success" type="AudioStreamPlayer" parent="." index="0"]
stream = ExtResource( 1 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="wrong" type="AudioStreamPlayer" parent="." index="1"]
stream = ExtResource( 2 )
volume_db = 0.0
pitch_scale = 1.0
autoplay = false
mix_target = 0
bus = "Master"
[node name="Background" type="ColorRect" parent="." index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 824.0
margin_bottom = 429.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
color = Color( 0.125856, 0.46875, 0.00183105, 1 )
[node name="margin" type="MarginContainer" parent="." index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_right = 20
custom_constants/margin_top = 20
custom_constants/margin_left = 20
custom_constants/margin_bottom = 20
_sections_unfolded = [ "custom_constants" ]
[node name="VBox" type="VBoxContainer" parent="margin" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 20.0
margin_top = 20.0
margin_right = 732.0
margin_bottom = 246.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="HBox" type="HBoxContainer" parent="margin/VBox" index="0"]
editor/display_folded = true
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 712.0
margin_bottom = 50.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Size Flags", "custom_constants" ]
[node name="Smile" parent="margin/VBox/HBox" index="0" instance=ExtResource( 3 )]
[node name="Task" parent="margin/VBox/HBox" index="1" instance=ExtResource( 4 )]
margin_right = 640.0
margin_bottom = 50.0
rect_min_size = Vector2( 640, 0 )
_sections_unfolded = [ "Margin", "Rect", "Size Flags" ]
[node name="VBox" type="VBoxContainer" parent="margin/VBox/HBox" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 644.0
margin_right = 694.0
margin_bottom = 50.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 8
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Rect", "Size Flags" ]
[node name="NextTaskButton" type="TextureButton" parent="margin/VBox/HBox/VBox" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 50.0
margin_bottom = 50.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
texture_normal = ExtResource( 5 )
texture_disabled = ExtResource( 6 )
_sections_unfolded = [ "Rect", "Size Flags", "Textures" ]
[node name="MarginContainer" type="MarginContainer" parent="margin/VBox" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 54.0
margin_right = 712.0
margin_bottom = 74.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_constants/margin_top = 20
_sections_unfolded = [ "Rect", "Size Flags", "custom_constants" ]
[node name="Abaco" parent="margin/VBox" index="2" instance=ExtResource( 7 )]
margin_top = 78.0
margin_right = 712.0
margin_bottom = 226.0
size_flags_horizontal = 4
[connection signal="answer_correct" from="margin/VBox/HBox/Task" to="." method="_on_Task_answer_correct"]
[connection signal="answer_wrong" from="margin/VBox/HBox/Task" to="." method="_on_Task_answer_wrong"]
[connection signal="pressed" from="margin/VBox/HBox/VBox/NextTaskButton" to="." method="_on_next_task"]