-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSlidePuzzleDemo.tscn
726 lines (592 loc) · 27.3 KB
/
SlidePuzzleDemo.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
[gd_scene load_steps=30 format=2]
[ext_resource path="res://addons/slidePuzzle/slidePuzzleTileMap.gd" type="Script" id=1]
[ext_resource path="res://assets/SlidePuzzleTileset.tres" type="TileSet" id=2]
[ext_resource path="res://assets/bluePiece.png" type="Texture" id=3]
[ext_resource path="res://assets/blueGoal.png" type="Texture" id=4]
[ext_resource path="res://SlidePuzzleDemo.gd" type="Script" id=5]
[ext_resource path="res://assets/PixelOperator8.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://assets/nextSlide.png" type="Texture" id=7]
[ext_resource path="res://assets/previousSlide.png" type="Texture" id=8]
[ext_resource path="res://Background.gd" type="Script" id=9]
[ext_resource path="res://assets/redPiece.png" type="Texture" id=10]
[ext_resource path="res://assets/redGoal.png" type="Texture" id=11]
[ext_resource path="res://assets/SimplestPuzzleExample.png" type="Texture" id=12]
[ext_resource path="res://assets/RedBluePieceExample.png" type="Texture" id=13]
[ext_resource path="res://assets/RedBluePieceTypesExample.png" type="Texture" id=14]
[ext_resource path="res://Slide4.gd" type="Script" id=15]
[ext_resource path="res://assets/listenToPiecesMoving.png" type="Texture" id=16]
[ext_resource path="res://assets/twoPathsExample.png" type="Texture" id=17]
[ext_resource path="res://assets/pieceCarrier.png" type="Texture" id=18]
[ext_resource path="res://assets/CarriersTileset.tres" type="TileSet" id=19]
[ext_resource path="res://assets/nodeStructureForCarriers.png" type="Texture" id=20]
[ext_resource path="res://assets/bluePieceHorizontalArrow.png" type="Texture" id=21]
[ext_resource path="res://src/allow_horizontal_move_only.gd" type="Script" id=22]
[ext_resource path="res://assets/bluePieceJoinedRight.png" type="Texture" id=23]
[ext_resource path="res://assets/bluePieceJoinedLeft.png" type="Texture" id=24]
[ext_resource path="res://assets/childSpritesExample.png" type="Texture" id=25]
[sub_resource type="DynamicFont" id=1]
size = 64
font_data = ExtResource( 6 )
[sub_resource type="Animation" id=2]
resource_name = "Solved"
tracks/0/type = "bezier"
tracks/0/path = NodePath(".:rect_rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"points": PoolRealArray( 5.1, -0.25, 0, 0.25, 0, -5.1, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5, 1 )
}
tracks/1/type = "bezier"
tracks/1/path = NodePath(".:rect_scale:x")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 1.5, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5, 1 )
}
tracks/2/type = "bezier"
tracks/2/path = NodePath(".:rect_scale:y")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 1.5, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0 ),
"times": PoolRealArray( 0, 0.5, 1 )
}
[sub_resource type="DynamicFont" id=3]
outline_size = 1
outline_color = Color( 0.121569, 0.121569, 0.121569, 1 )
font_data = ExtResource( 6 )
[sub_resource type="DynamicFont" id=4]
size = 24
outline_size = 1
font_data = ExtResource( 6 )
[node name="SlidePuzzleDemo" type="Node2D"]
script = ExtResource( 5 )
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="nextSlide" type="TextureButton" parent="CanvasLayer"]
margin_left = 976.393
margin_top = 559.285
margin_right = 1008.39
margin_bottom = 591.285
texture_normal = ExtResource( 7 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="previousSlide" type="TextureButton" parent="CanvasLayer"]
visible = false
margin_left = 15.4756
margin_top = 559.285
margin_right = 47.4756
margin_bottom = 591.285
texture_normal = ExtResource( 8 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PuzzleSolved" type="Label" parent="CanvasLayer"]
visible = false
margin_left = 128.0
margin_top = 448.0
margin_right = 896.0
margin_bottom = 512.0
rect_rotation = 5.1
rect_scale = Vector2( 1e-05, 1e-05 )
rect_pivot_offset = Vector2( 384, 32 )
custom_fonts/font = SubResource( 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_shadow = Color( 0.203922, 0.203922, 0.203922, 1 )
custom_constants/shadow_offset_x = 4
custom_constants/shadow_offset_y = 4
text = "Puzzle Solved"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Player" type="AnimationPlayer" parent="CanvasLayer/PuzzleSolved"]
anims/Solved = SubResource( 2 )
[node name="Background" type="Sprite" parent="."]
centered = false
script = ExtResource( 9 )
[node name="Camera2D" type="Camera2D" parent="Background"]
anchor_mode = 0
current = true
drag_margin_left = 1.0
drag_margin_top = 1.0
drag_margin_right = 1.0
drag_margin_bottom = 1.0
editor_draw_limits = true
editor_draw_drag_margin = true
[node name="Tween" type="Tween" parent="Background"]
[node name="Slide1" type="Node" parent="."]
[node name="FirstExample" type="TileMap" parent="Slide1"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 524289, 0, 0, 524290, 0, 0, 524291, 0, 0, 524292, 0, 0, 524293, 0, 0, 524294, 0, 0, 524295, 0, 0, 524296, 0, 0, 524297, 0, 0, 524298, 0, 0, 524299, 0, 0, 524300, 0, 0, 524301, 0, 0, 524302, 0, 0 )
script = ExtResource( 1 )
puzzle_name = "First"
[node name="Pieces" type="Node" parent="Slide1/FirstExample"]
[node name="Blue" type="Node" parent="Slide1/FirstExample/Pieces"]
[node name="Pieces" type="Node" parent="Slide1/FirstExample/Pieces/Blue"]
[node name="BluePiece1" type="Sprite" parent="Slide1/FirstExample/Pieces/Blue/Pieces" groups=[
"sp_blue",
"sp_piece",
]]
position = Vector2( 64, 512 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="Goals" type="Node" parent="Slide1/FirstExample/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide1/FirstExample/Pieces/Blue/Goals" groups=[
"spclass_blue",
"sptype_goal",
]]
position = Vector2( 896, 512 )
texture = ExtResource( 4 )
centered = false
[node name="Slide1Text" type="RichTextLabel" parent="Slide1"]
margin_left = 64.0
margin_top = 64.0
margin_right = 768.0
margin_bottom = 512.0
custom_fonts/normal_font = SubResource( 3 )
text = " First copy the addon folder inside your Godot project
Then to activate the plugin open \"Project Settings>Plugins\" and change from \"Inactive\" to \"Active\" on the slidePuzzle entry
Go to your 2d scene and \"add child node>Slide Puzzle\" (it should be below TileMap)
Configure \"Slide puzzle\" to have a cell size equals to you pieces size
Configure you scene to snap elements to your cell size
Add a child node Node and name it Pieces.
For each piece type add a child node.
So for example if you have a red piece and a blue piece you would add a Node Blue and a node Red.
Inside each piece node you also need two nodes Pieces and Goals
On Pieces add the sprites for the pieces. They should have the cell size of SlidePuzzle and should be aligned with the grid.
Don't forget to uncheck centered inside \"Offset>Centered\".
On Goals add the sprites for the goals. Also should have the same cell size and be aligned.
After that draw some cells, put the piece sprite and the goal sprite somewhere over the cell path."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DragThis" type="Label" parent="Slide1"]
margin_left = 128.0
margin_top = 512.0
margin_right = 635.0
margin_bottom = 576.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 0.8, 0.8, 0.8, 1 )
custom_constants/shadow_offset_x = 3
custom_constants/shadow_offset_y = 3
text = "Drag this to your right --->"
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GodotNodeStructurePicture" type="Sprite" parent="Slide1"]
position = Vector2( 896, 256 )
texture = ExtResource( 12 )
[node name="Slide2" type="Node" parent="."]
[node name="Slide2Text" type="RichTextLabel" parent="Slide2"]
margin_left = 1408.0
margin_top = 64.0
margin_right = 1984.0
margin_bottom = 448.0
custom_fonts/normal_font = SubResource( 3 )
text = " In this example we have two types of pieces. The pieces block each other. Try solving this puzzle."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide2"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 196636, 0, 0, 262166, 0, 0, 262167, 0, 0, 262168, 0, 0, 262169, 0, 0, 262170, 0, 0, 262171, 0, 0, 262172, 0, 0, 262173, 0, 0, 262174, 0, 0 )
script = ExtResource( 1 )
puzzle_name = "Second"
[node name="Pieces" type="Node" parent="Slide2/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide2/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide2/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece1" type="Sprite" parent="Slide2/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 1472, 256 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="Goals" type="Node" parent="Slide2/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide2/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 1856, 256 )
texture = ExtResource( 4 )
centered = false
[node name="Red" type="Node" parent="Slide2/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide2/SlidePuzzle/Pieces/Red"]
[node name="RedPiece" type="Sprite" parent="Slide2/SlidePuzzle/Pieces/Red/Pieces"]
position = Vector2( 1408, 256 )
z_index = 1
texture = ExtResource( 10 )
centered = false
[node name="Goals" type="Node" parent="Slide2/SlidePuzzle/Pieces/Red"]
[node name="RedGoal" type="Sprite" parent="Slide2/SlidePuzzle/Pieces/Red/Goals"]
position = Vector2( 1920, 256 )
texture = ExtResource( 11 )
centered = false
[node name="GodotNodeStructurePicture" type="Sprite" parent="Slide2"]
position = Vector2( 1216, 320 )
texture = ExtResource( 13 )
[node name="Slide3" type="Node" parent="."]
[node name="Slide3Text" type="RichTextLabel" parent="Slide3"]
margin_left = 2112.0
margin_top = 64.0
margin_right = 2816.0
margin_bottom = 192.0
custom_fonts/normal_font = SubResource( 3 )
text = " You can have more than one piece of each type. Each piece can go into any of the goals for that type of piece. Try putting the pieces with the same color on any of the goals for that color in this example."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide3"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 262177, 0, 0, 262178, 0, 0, 262179, 0, 0, 262180, 0, 0, 262181, 0, 0, 262182, 0, 0, 262183, 0, 0, 262184, 0, 0, 262185, 0, 0, 262186, 0, 0, 262187, 0, 0, 327713, 0, 0, 327714, 0, 0, 327715, 0, 0, 327716, 0, 0, 327717, 0, 0, 327718, 0, 0, 327719, 0, 0, 327720, 0, 0, 327721, 0, 0, 327722, 0, 0, 327723, 0, 0 )
script = ExtResource( 1 )
[node name="Pieces" type="Node" parent="Slide3/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide3/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide3/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 2112, 256 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="BluePiece2" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 2176, 320 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="Goals" type="Node" parent="Slide3/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 2752, 256 )
texture = ExtResource( 4 )
centered = false
[node name="BlueGoal2" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 2752, 320 )
texture = ExtResource( 4 )
centered = false
[node name="Red" type="Node" parent="Slide3/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide3/SlidePuzzle/Pieces/Red"]
[node name="RedPiece" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Red/Pieces"]
position = Vector2( 2112, 320 )
z_index = 1
texture = ExtResource( 10 )
centered = false
[node name="RedPiece2" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Red/Pieces"]
position = Vector2( 2176, 256 )
z_index = 1
texture = ExtResource( 10 )
centered = false
[node name="Goals" type="Node" parent="Slide3/SlidePuzzle/Pieces/Red"]
[node name="RedGoal" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Red/Goals"]
position = Vector2( 2688, 320 )
texture = ExtResource( 11 )
centered = false
[node name="RedGoal2" type="Sprite" parent="Slide3/SlidePuzzle/Pieces/Red/Goals"]
position = Vector2( 2688, 256 )
texture = ExtResource( 11 )
centered = false
[node name="GodotNodeStructurePicture" type="Sprite" parent="Slide3"]
position = Vector2( 2944, 320 )
scale = Vector2( 0.793578, 0.798137 )
texture = ExtResource( 14 )
[node name="Slide4" type="Node" parent="."]
script = ExtResource( 15 )
[node name="Slide4Text" type="RichTextLabel" parent="Slide4"]
margin_left = 3136.0
margin_top = 64.0
margin_right = 4032.0
margin_bottom = 192.0
custom_fonts/normal_font = SubResource( 3 )
text = " On this example we listen to the position of the pieces so we can trigger events when a certain kind of piece is on a given position."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DragBluePieceHere" type="Label" parent="Slide4"]
margin_left = 3456.0
margin_top = 192.0
margin_right = 3990.0
margin_bottom = 256.0
custom_fonts/font = SubResource( 4 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 0.8, 0.8, 0.8, 1 )
custom_constants/shadow_offset_x = 3
custom_constants/shadow_offset_y = 3
text = " Drag the blue piece here --->"
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide4"]
z_index = -1
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 196662, 0, 0, 196663, 0, 0, 196664, 0, 0, 196665, 0, 0, 196666, 0, 0, 196667, 0, 0, 196668, 0, 0, 196669, 0, 0, 196670, 0, 0, 262198, 0, 0, 327734, 0, 0, 327736, 0, 0, 327737, 0, 0, 327738, 0, 0, 327739, 0, 0, 327740, 0, 0, 327741, 0, 0, 327742, 0, 0, 393265, 0, 0, 393266, 0, 0, 393267, 0, 0, 393268, 0, 0, 393269, 0, 0, 393270, 0, 0, 458806, 0, 0, 524342, 0, 0 )
script = ExtResource( 1 )
[node name="Pieces" type="Node" parent="Slide4/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide4/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide4/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece" type="Sprite" parent="Slide4/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 3200, 384 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="Goals" type="Node" parent="Slide4/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide4/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 3456, 512 )
texture = ExtResource( 4 )
centered = false
[node name="Red" type="Node" parent="Slide4/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide4/SlidePuzzle/Pieces/Red"]
[node name="RedPiece" type="Sprite" parent="Slide4/SlidePuzzle/Pieces/Red/Pieces"]
position = Vector2( 3136, 384 )
z_index = 1
texture = ExtResource( 10 )
centered = false
[node name="Goals" type="Node" parent="Slide4/SlidePuzzle/Pieces/Red"]
[node name="RedGoal" type="Sprite" parent="Slide4/SlidePuzzle/Pieces/Red/Goals"]
position = Vector2( 3968, 320 )
texture = ExtResource( 11 )
centered = false
[node name="ListenToPiecesMovingCodeExample" type="Sprite" parent="Slide4"]
position = Vector2( 3776, 512 )
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 16 )
[node name="Slide5" type="Node" parent="."]
[node name="Slide5Text" type="RichTextLabel" parent="Slide5"]
margin_left = 4160.0
margin_top = 64.0
margin_right = 5056.0
margin_bottom = 128.0
custom_fonts/normal_font = SubResource( 3 )
text = " You can also have paths that are exclusive to a single piece type. For this just add a TileMap as a child of the Piece type node and name it \"Path\"."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide5"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 131141, 3, 0, 131142, 3, 0, 131143, 3, 0, 131144, 3, 0, 131145, 3, 0, 131146, 3, 0, 131147, 3, 0, 196680, 3, 0, 262216, 3, 0, 327752, 3, 0, 393288, 3, 0 )
script = ExtResource( 1 )
[node name="Pieces" type="Node" parent="Slide5/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide5/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide5/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece" type="Sprite" parent="Slide5/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 4416, 128 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="Goals" type="Node" parent="Slide5/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide5/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 4544, 512 )
texture = ExtResource( 4 )
centered = false
[node name="Path" type="TileMap" parent="Slide5/SlidePuzzle/Pieces/Blue"]
z_index = -1
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 393285, 1, 0, 393286, 1, 0, 393287, 1, 0, 458821, 1, 0, 524357, 1, 0, 524358, 1, 0, 524359, 1, 0 )
[node name="Red" type="Node" parent="Slide5/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide5/SlidePuzzle/Pieces/Red"]
[node name="RedPiece" type="Sprite" parent="Slide5/SlidePuzzle/Pieces/Red/Pieces"]
position = Vector2( 4800, 128 )
z_index = 1
texture = ExtResource( 10 )
centered = false
[node name="Goals" type="Node" parent="Slide5/SlidePuzzle/Pieces/Red"]
[node name="RedGoal" type="Sprite" parent="Slide5/SlidePuzzle/Pieces/Red/Goals"]
position = Vector2( 4672, 512 )
texture = ExtResource( 11 )
centered = false
[node name="Path" type="TileMap" parent="Slide5/SlidePuzzle/Pieces/Red"]
z_index = -1
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 393289, 2, 0, 393290, 2, 0, 393291, 2, 0, 458827, 2, 0, 524361, 2, 0, 524362, 2, 0, 524363, 2, 0 )
[node name="GodotNodeStructurePicture" type="Sprite" parent="Slide5"]
position = Vector2( 4275.37, 352.421 )
scale = Vector2( 0.8, 0.8 )
texture = ExtResource( 17 )
[node name="Slide6" type="Node" parent="."]
[node name="Slide6Text" type="RichTextLabel" parent="Slide6"]
margin_left = 5184.0
margin_top = 64.0
margin_right = 5888.0
margin_bottom = 256.0
custom_fonts/normal_font = SubResource( 3 )
text = " There is a special type of piece called \"Carrier\". The carrier have its own path and it can carry a piece with it. To add one you need a node called \"Carriers\" where the carriers sprites will be and a Tilemap called CarriersPath.
Try dragging the carrier near the blue piece and then drag the blue piece inside the carrier. Then drag the carrier to the right part of the path and drag the blue piece to the goal."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide6"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 327761, 0, 0, 327771, 0, 0, 393297, 0, 0, 393307, 0, 0 )
script = ExtResource( 1 )
[node name="Carriers" type="Node" parent="Slide6/SlidePuzzle"]
[node name="Carrier" type="Sprite" parent="Slide6/SlidePuzzle/Carriers"]
position = Vector2( 5504, 448 )
texture = ExtResource( 18 )
centered = false
[node name="Pieces" type="Node" parent="Slide6/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide6/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide6/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece" type="Sprite" parent="Slide6/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 5184, 320 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="Goals" type="Node" parent="Slide6/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide6/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 5824, 320 )
texture = ExtResource( 4 )
centered = false
[node name="CarriersPath" type="TileMap" parent="Slide6/SlidePuzzle"]
tile_set = ExtResource( 19 )
format = 1
tile_data = PoolIntArray( 458833, 0, 0, 458834, 0, 0, 458835, 0, 0, 458836, 0, 0, 458837, 0, 0, 458838, 0, 0, 458839, 0, 0, 458840, 0, 0, 458841, 0, 0, 458842, 0, 0, 458843, 0, 0 )
[node name="Sprite" type="Sprite" parent="Slide6"]
position = Vector2( 6016, 256 )
texture = ExtResource( 20 )
[node name="Slide7" type="Node" parent="."]
[node name="Slide7Text" type="RichTextLabel" parent="Slide7"]
margin_left = 6177.0
margin_top = 64.0
margin_right = 7201.0
margin_bottom = 256.0
custom_fonts/normal_font = SubResource( 3 )
text = " You can also create custom rule for what tiles each piece is allowed to use. Create a script with a function:
static func move_is_allowed(piece: Sprite, destination: Vector2) -> bool:
In this example we allow the Blue Piece to move only horizontally."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide7"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 262245, 0, 0, 262246, 0, 0, 262247, 0, 0, 262248, 0, 0, 262249, 0, 0, 262250, 0, 0, 327781, 0, 0, 327782, 0, 0, 327783, 0, 0, 327784, 0, 0, 327785, 0, 0, 327786, 0, 0, 393317, 0, 0, 393318, 0, 0, 393319, 0, 0, 393320, 0, 0, 393321, 0, 0, 393322, 0, 0 )
script = ExtResource( 1 )
allow_tiles_script = ExtResource( 22 )
[node name="Pieces" type="Node" parent="Slide7/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide7/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide7/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece3" type="Sprite" parent="Slide7/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 6528, 320 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="BluePiece" type="Sprite" parent="Slide7/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 6656, 320 )
z_index = 2
texture = ExtResource( 21 )
centered = false
[node name="Goals" type="Node" parent="Slide7/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide7/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 6784, 384 )
texture = ExtResource( 4 )
centered = false
[node name="BlueGoal2" type="Sprite" parent="Slide7/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 6720, 384 )
texture = ExtResource( 4 )
centered = false
[node name="Carriers" type="Node" parent="Slide7/SlidePuzzle"]
[node name="Carrier" type="Sprite" parent="Slide7/SlidePuzzle/Carriers"]
position = Vector2( 6400, 384 )
texture = ExtResource( 18 )
centered = false
[node name="CarriersPath" type="TileMap" parent="Slide7/SlidePuzzle"]
tile_set = ExtResource( 19 )
format = 1
tile_data = PoolIntArray( 196707, 0, 0, 196708, 0, 0, 196709, 0, 0, 196710, 0, 0, 196711, 0, 0, 196712, 0, 0, 196713, 0, 0, 196714, 0, 0, 196715, 0, 0, 262243, 0, 0, 262251, 0, 0, 327779, 0, 0, 327787, 0, 0, 393315, 0, 0, 393316, 0, 0 )
[node name="Slide8" type="Node" parent="."]
[node name="Slide8Text" type="RichTextLabel" parent="Slide8"]
margin_left = 7232.0
margin_top = 64.0
margin_right = 8192.0
margin_bottom = 128.0
custom_fonts/normal_font = SubResource( 3 )
text = "If you add sprites as a children of one piece they will also be pieces of the same type as the parent. They will be joined together and unless all of them can move dragging will be blocked."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Slide8Text2" type="RichTextLabel" parent="Slide8"]
margin_left = 7744.0
margin_top = 448.0
margin_right = 8256.0
margin_bottom = 512.0
custom_fonts/normal_font = SubResource( 3 )
text = "Now go make some games!!!
And send me a free copy :)"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SlidePuzzle" type="TileMap" parent="Slide8"]
tile_set = ExtResource( 2 )
format = 1
tile_data = PoolIntArray( 196721, 0, 0, 196722, 0, 0, 196723, 0, 0, 196724, 0, 0, 196725, 0, 0, 196726, 0, 0, 196727, 0, 0, 262257, 0, 0, 262258, 0, 0, 262259, 0, 0, 262260, 0, 0, 262261, 0, 0, 262262, 0, 0, 262263, 0, 0, 327793, 0, 0, 327794, 0, 0, 327795, 0, 0, 327796, 0, 0, 327797, 0, 0, 327798, 0, 0, 327799, 0, 0, 393329, 0, 0, 393330, 0, 0, 393331, 0, 0, 393332, 0, 0, 393333, 0, 0, 393334, 0, 0, 393335, 0, 0, 458865, 0, 0, 458866, 0, 0, 458867, 0, 0, 458868, 0, 0, 458869, 0, 0, 458870, 0, 0, 458871, 0, 0 )
script = ExtResource( 1 )
puzzle_name = "PuzzleSlide8"
[node name="Pieces" type="Node" parent="Slide8/SlidePuzzle"]
[node name="Blue" type="Node" parent="Slide8/SlidePuzzle/Pieces"]
[node name="Pieces" type="Node" parent="Slide8/SlidePuzzle/Pieces/Blue"]
[node name="BluePiece2" type="Sprite" parent="Slide8/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 7296, 256 )
z_index = 1
texture = ExtResource( 3 )
centered = false
[node name="BluePiece" type="Sprite" parent="Slide8/SlidePuzzle/Pieces/Blue/Pieces"]
position = Vector2( 7296, 320 )
z_index = 2
texture = ExtResource( 24 )
centered = false
[node name="ChildPiece" type="Sprite" parent="Slide8/SlidePuzzle/Pieces/Blue/Pieces/BluePiece"]
position = Vector2( 64, 0 )
z_index = 2
texture = ExtResource( 23 )
centered = false
[node name="Goals" type="Node" parent="Slide8/SlidePuzzle/Pieces/Blue"]
[node name="BlueGoal" type="Sprite" parent="Slide8/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 7552, 320 )
texture = ExtResource( 4 )
centered = false
[node name="BlueGoal2" type="Sprite" parent="Slide8/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 7552, 384 )
texture = ExtResource( 4 )
centered = false
[node name="BlueGoal3" type="Sprite" parent="Slide8/SlidePuzzle/Pieces/Blue/Goals"]
position = Vector2( 7616, 320 )
texture = ExtResource( 4 )
centered = false
[node name="Sprite" type="Sprite" parent="Slide8"]
position = Vector2( 7936, 320 )
texture = ExtResource( 25 )
[connection signal="button_down" from="CanvasLayer/nextSlide" to="." method="_on_nextSlide_button_down"]
[connection signal="button_down" from="CanvasLayer/previousSlide" to="." method="_on_previousSlide_button_down"]
[connection signal="tween_all_completed" from="Background/Tween" to="." method="_on_Tween_tween_all_completed"]
[connection signal="puzzle_solved" from="Slide1/FirstExample" to="." method="_on_puzzle_solved"]
[connection signal="puzzle_solved" from="Slide2/SlidePuzzle" to="." method="_on_puzzle_solved"]
[connection signal="puzzle_solved" from="Slide3/SlidePuzzle" to="." method="_on_puzzle_solved"]
[connection signal="piece_moved" from="Slide4/SlidePuzzle" to="Slide4" method="_on_SlidePuzzle_piece_moved"]
[connection signal="puzzle_solved" from="Slide4/SlidePuzzle" to="." method="_on_puzzle_solved"]
[connection signal="puzzle_solved" from="Slide5/SlidePuzzle" to="." method="_on_puzzle_solved"]
[connection signal="clicked_piece" from="Slide6/SlidePuzzle" to="." method="_on_SlidePuzzle_clicked_piece"]
[connection signal="clicked_tile" from="Slide6/SlidePuzzle" to="." method="_on_SlidePuzzle_clicked_tile"]
[connection signal="piece_entered_goal" from="Slide6/SlidePuzzle" to="." method="_on_SlidePuzzle_piece_entered_goal"]
[connection signal="piece_moved" from="Slide6/SlidePuzzle" to="." method="_on_SlidePuzzle_piece_moved"]
[connection signal="piece_released" from="Slide6/SlidePuzzle" to="." method="_on_SlidePuzzle_piece_released"]
[connection signal="puzzle_solved" from="Slide6/SlidePuzzle" to="." method="_on_puzzle_solved"]
[connection signal="puzzle_solved" from="Slide7/SlidePuzzle" to="." method="_on_puzzle_solved"]
[connection signal="clicked_piece" from="Slide8/SlidePuzzle" to="." method="_on_SlidePuzzle_clicked_piece"]
[connection signal="clicked_tile" from="Slide8/SlidePuzzle" to="." method="_on_SlidePuzzle_clicked_tile"]
[connection signal="piece_entered_goal" from="Slide8/SlidePuzzle" to="." method="_on_SlidePuzzle_piece_entered_goal"]
[connection signal="piece_moved" from="Slide8/SlidePuzzle" to="." method="_on_SlidePuzzle_piece_moved"]
[connection signal="piece_released" from="Slide8/SlidePuzzle" to="." method="_on_SlidePuzzle_piece_released"]
[connection signal="puzzle_solved" from="Slide8/SlidePuzzle" to="." method="_on_puzzle_solved"]