-
Notifications
You must be signed in to change notification settings - Fork 2
/
Langton.tscn
261 lines (223 loc) · 7.03 KB
/
Langton.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
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
[gd_scene load_steps=12 format=1]
[ext_resource path="res://Langton.gd" type="Script" id=1]
[ext_resource path="res://ant_b.png" type="Texture" id=2]
[ext_resource path="res://ant_w.png" type="Texture" id=3]
[ext_resource path="res://blackwhite.tres" type="TileSet" id=4]
[ext_resource path="res://DejaVuSansMono.ttf" type="DynamicFontData" id=5]
[ext_resource path="res://grabber.png" type="Texture" id=6]
[ext_resource path="res://slider.png" type="Texture" id=7]
[sub_resource type="Animation" id=1]
resource/name = "Langton"
length = 0.5
loop = true
loop_interpolation = true
step = 0.1
tracks/0/type = "method"
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0.01 ), "transitions":FloatArray( 1 ), "values":[ { "args":[ ], "method":"move_ant" } ] }
[sub_resource type="DynamicFont" id=2]
font/size = 16
font/font = ExtResource( 5 )
fallback/0 = null
[sub_resource type="StyleBoxTexture" id=3]
content_margin/left = -1.0
content_margin/right = -1.0
content_margin/top = -1.0
content_margin/bottom = -1.0
texture = ExtResource( 7 )
region_rect = Rect2( 0, 0, 20, 10 )
margin/left = 2.0
margin/right = 2.0
margin/top = 2.0
margin/bottom = 2.0
expand_margin/left = 1.0
expand_margin/right = 1.0
expand_margin/top = 1.0
expand_margin/bottom = 1.0
draw_center = true
[sub_resource type="Animation" id=4]
resource/name = "image_saved"
length = 5.0
loop = false
loop_interpolation = true
step = 0.05
tracks/0/type = "value"
tracks/0/path = NodePath("ImageMessage:visibility/opacity")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0, 4, 5 ), "transitions":FloatArray( 1, 1, 1 ), "update":0, "values":[ 1.0, 1.0, 0.0 ] }
tracks/1/type = "method"
tracks/1/path = NodePath("ImageMessage")
tracks/1/interp = 1
tracks/1/imported = false
tracks/1/keys = { "times":FloatArray( 0, 5 ), "transitions":FloatArray( 1, 1 ), "values":[ { "args":[ "Image saved!" ], "method":"set_text" }, { "args":[ "" ], "method":"set_text" } ] }
[node name="Langton" type="Node2D"]
script/script = ExtResource( 1 )
grid_size = Rect2( -200, -200, 700, 400 )
default_speed = 1.0
show_instructions = true
black_ant = ExtResource( 2 )
white_ant = ExtResource( 3 )
ant_start = Vector2( 50, 30 )
[node name="Grid" type="TileMap" parent="."]
mode = 0
tile_set = ExtResource( 4 )
cell/size = Vector2( 10, 10 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 0
cell/y_sort = false
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( )
[node name="AntMarker" type="Sprite" parent="."]
[node name="Camera" type="Camera2D" parent="."]
anchor_mode = 0
rotating = false
current = true
zoom = Vector2( 1, 1 )
limit/left = -100
limit/top = -100
limit/right = 200
limit/bottom = 200
drag_margin/h_enabled = false
drag_margin/v_enabled = false
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2
[node name="Animation" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/Langton = SubResource( 1 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = ""
[node name="GUI" type="CanvasLayer" parent="."]
layer = 1
offset = Vector2( 0, 0 )
rotation = 0.0
scale = Vector2( 1, 1 )
[node name="Instructions" type="Label" parent="GUI"]
anchor/right = 1
anchor/bottom = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 15.0
margin/top = 35.0
margin/right = 15.0
margin/bottom = 15.0
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 1, 1, 1, 1 )
custom_constants/shadow_as_outline = 1
text = "Press F1 to show/hide this message.\nPress SPACE to start and pause.\nPress ESC to reset the grid.\nPress F2 to show/hide controls.\nPress F3 to show/hide ant marker.\nPress F11 to go fullscreen.\nClick with LEFT mouse button to make a tile black (while paused).\nClick with RIGHT mouse button to make a tile white (while paused).\nDrag with MIDDLE mouse button pressed to move the camera.\nPress F12 to save an image in your user folder (may take a while).\n"
align = 2
autowrap = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Speed" type="HSlider" parent="GUI"]
anchor/right = 3
hint/tooltip = "Change the animation speed"
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 10.0
margin/top = 10.0
margin/right = 0.0
margin/bottom = 16.0
custom_icons/grabber_hilite = ExtResource( 6 )
custom_icons/grabber = ExtResource( 6 )
custom_styles/slider = SubResource( 3 )
range/min = 0.1
range/max = 20.0
range/step = 0.1
range/page = 0.0
range/value = 1.0
range/exp_edit = true
range/rounded = false
tick_count = 10
ticks_on_borders = false
focus_mode = 2
[node name="SpeedShow" type="Label" parent="GUI"]
anchor/left = 3
anchor/right = 3
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = -5.0
margin/top = 5.0
margin/right = -30.0
margin/bottom = 24.0
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 1, 1, 1, 1 )
custom_constants/shadow_as_outline = 1
text = "1x"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="CameraPos" type="Label" parent="GUI"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 15.0
margin/top = 25.0
margin/right = 670.0
margin/bottom = 15.0
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 1, 1, 1, 1 )
custom_constants/shadow_as_outline = 1
text = "0, 0"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="ImageMessage" type="Label" parent="GUI"]
anchor/left = 3
anchor/top = 1
anchor/right = 1
anchor/bottom = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 0.0
margin/top = 25.0
margin/right = 15.0
margin/bottom = 15.0
custom_fonts/font = SubResource( 2 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 1, 1, 1, 1 )
custom_constants/shadow_as_outline = 1
align = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="GUIAnimation" type="AnimationPlayer" parent="GUI"]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/image_saved = SubResource( 4 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = ""
[connection signal="image_saved" from="." to="." method="_on_image_saved"]
[connection signal="value_changed" from="GUI/Speed" to="." method="_on_speed_value_changed"]
[connection signal="mouse_enter" from="GUI/Speed" to="." method="_on_speed_mouse_enter"]
[connection signal="mouse_exit" from="GUI/Speed" to="." method="_on_speed_mouse_exit"]