1- [gd_scene load_steps =17 format =3 uid ="uid://b7gyfmfo5wtm1" ]
1+ [gd_scene load_steps =27 format =3 uid ="uid://b7gyfmfo5wtm1" ]
22
33[ext_resource type ="TileSet" uid ="uid://bmkax0b814rmy" path ="res://game-03/spaces/tileset-a.tres" id ="1_fn3w6" ]
44[ext_resource type ="Script" path ="res://addons/block_code/block_code_node/block_code.gd" id ="2_xy6in" ]
55[ext_resource type ="Script" path ="res://addons/block_code/serialization/block_serialization_tree.gd" id ="3_6j5ma" ]
66[ext_resource type ="Script" path ="res://addons/block_code/serialization/block_serialization.gd" id ="3_r18qn" ]
7- [ext_resource type ="Script" path ="res://addons/block_code/code_generation/option_data .gd" id ="5_0w7ia " ]
7+ [ext_resource type ="Script" path ="res://addons/block_code/serialization/value_block_serialization .gd" id ="5_83svu " ]
88[ext_resource type ="Script" path ="res://addons/block_code/serialization/block_script_serialization.gd" id ="5_a0j4o" ]
99[ext_resource type ="Script" path ="res://addons/block_code/code_generation/variable_definition.gd" id ="6_yyx0f" ]
1010
1111[sub_resource type ="RectangleShape2D" id ="RectangleShape2D_5opsn" ]
1212size = Vector2 (256 , 112 )
1313
1414[sub_resource type ="Animation" id ="Animation_vuag3" ]
15- length = 0.001
1615tracks/0/type = "value"
1716tracks/0/imported = false
1817tracks/0/enabled = true
1918tracks/0/path = NodePath ("RigidBody2D:position" )
2019tracks/0/interp = 1
2120tracks/0/loop_wrap = true
2221tracks/0/keys = {
23- "times" : PackedFloat32Array (0 ),
24- "transitions" : PackedFloat32Array (1 ),
22+ "times" : PackedFloat32Array (0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 1 ),
23+ "transitions" : PackedFloat32Array (1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ),
2524"update" : 0 ,
26- "values" : [Vector2 (0 , 0 )]
25+ "values" : [Vector2 (0 , 0 ), Vector2 ( 10 , -5 ), Vector2 ( -10 , -5 ), Vector2 ( -10 , 5 ), Vector2 ( 0 , 5 ), Vector2 ( 10 , 5 ), Vector2 ( 0 , 0 ), Vector2 ( 0 , 600 ) ]
2726}
2827
2928[sub_resource type ="Animation" id ="Animation_o6p3a" ]
@@ -48,47 +47,131 @@ _data = {
4847"shake" : SubResource ("Animation_o6p3a" )
4948}
5049
51- [sub_resource type ="Resource" id ="Resource_y6vh7" ]
52- script = ExtResource ("5_0w7ia" )
53- selected = 0
54- items = ["ahead" , "backwards" ]
55-
56- [sub_resource type ="Resource" id ="Resource_qhpan" ]
50+ [sub_resource type ="Resource" id ="Resource_71dy5" ]
5751script = ExtResource ("3_r18qn" )
5852name = &"animationplayer_play"
5953children = Array[ExtResource ("3_r18qn" )]([])
6054arguments = {
6155"animation" : "shake" ,
62- "direction" : SubResource ("Resource_y6vh7" )
56+ "direction" : "forward" ,
57+ "wait_mode" : "until done"
58+ }
59+
60+ [sub_resource type ="Resource" id ="Resource_wkip3" ]
61+ script = ExtResource ("5_83svu" )
62+ name = &"get_node"
63+ arguments = {
64+ "path" : NodePath ("../.." )
6365}
6466
65- [sub_resource type ="Resource" id ="Resource_31up2" ]
67+ [sub_resource type ="Resource" id ="Resource_r4ifk" ]
68+ script = ExtResource ("3_r18qn" )
69+ name = &"queue_free_node"
70+ children = Array[ExtResource ("3_r18qn" )]([])
71+ arguments = {
72+ "node" : SubResource ("Resource_wkip3" )
73+ }
74+
75+ [sub_resource type ="Resource" id ="Resource_15x7q" ]
6676script = ExtResource ("3_r18qn" )
6777name = &"define_method"
68- children = Array[ExtResource ("3_r18qn" )]([SubResource ("Resource_qhpan " )])
78+ children = Array[ExtResource ("3_r18qn" )]([SubResource ("Resource_71dy5" ), SubResource ( "Resource_r4ifk " )])
6979arguments = {
7080"method_name" : &"play_shake"
7181}
7282
73- [sub_resource type ="Resource" id ="Resource_0pxlj " ]
83+ [sub_resource type ="Resource" id ="Resource_bvj0i " ]
7484script = ExtResource ("3_6j5ma" )
75- root = SubResource ("Resource_31up2 " )
85+ root = SubResource ("Resource_15x7q " )
7686canvas_position = Vector2 (100 , 75 )
7787
7888[sub_resource type ="Resource" id ="Resource_6q7jc" ]
7989script = ExtResource ("5_a0j4o" )
8090script_inherits = "AnimationPlayer"
81- block_serialization_trees = Array[ExtResource ("3_6j5ma" )]([SubResource ("Resource_0pxlj " )])
91+ block_serialization_trees = Array[ExtResource ("3_6j5ma" )]([SubResource ("Resource_bvj0i " )])
8292variables = Array[ExtResource ("6_yyx0f" )]([])
8393generated_script = "extends AnimationPlayer
8494
8595
8696func play_shake():
87- if \" ahead \" == \" ahead \" :
97+ if 'forward' == \" forward \" :
8898play('shake')
8999else:
90100play_backwards('shake')
101+ if 'until done' == \" until done\" :
102+ await animation_finished
103+
104+ (get_node(\" ../..\" )).queue_free()
105+
106+ "
107+ version = 0
108+
109+ [sub_resource type ="RectangleShape2D" id ="RectangleShape2D_3ufhb" ]
110+ size = Vector2 (256 , 8 )
111+
112+ [sub_resource type ="Resource" id ="Resource_qh7d5" ]
113+ script = ExtResource ("5_83svu" )
114+ name = &"area2d_on_entered:something"
115+ arguments = {}
116+
117+ [sub_resource type ="Resource" id ="Resource_e6pu7" ]
118+ script = ExtResource ("5_83svu" )
119+ name = &"is_node_in_group"
120+ arguments = {
121+ "group" : "player" ,
122+ "node" : SubResource ("Resource_qh7d5" )
123+ }
124+
125+ [sub_resource type ="Resource" id ="Resource_xq1nr" ]
126+ script = ExtResource ("5_83svu" )
127+ name = &"get_node"
128+ arguments = {
129+ "path" : NodePath ("../RigidBody2D/AnimationPlayer" )
130+ }
131+
132+ [sub_resource type ="Resource" id ="Resource_5a1us" ]
133+ script = ExtResource ("3_r18qn" )
134+ name = &"call_method_node"
135+ children = Array[ExtResource ("3_r18qn" )]([])
136+ arguments = {
137+ "method_name" : "play_shake" ,
138+ "node" : SubResource ("Resource_xq1nr" )
139+ }
140+
141+ [sub_resource type ="Resource" id ="Resource_d8dep" ]
142+ script = ExtResource ("3_r18qn" )
143+ name = &"if"
144+ children = Array[ExtResource ("3_r18qn" )]([SubResource ("Resource_5a1us" )])
145+ arguments = {
146+ "condition" : SubResource ("Resource_e6pu7" )
147+ }
148+
149+ [sub_resource type ="Resource" id ="Resource_dm1fd" ]
150+ script = ExtResource ("3_r18qn" )
151+ name = &"area2d_on_entered"
152+ children = Array[ExtResource ("3_r18qn" )]([SubResource ("Resource_d8dep" )])
153+ arguments = {}
154+
155+ [sub_resource type ="Resource" id ="Resource_jegfr" ]
156+ script = ExtResource ("3_6j5ma" )
157+ root = SubResource ("Resource_dm1fd" )
158+ canvas_position = Vector2 (75 , 75 )
159+
160+ [sub_resource type ="Resource" id ="Resource_cri4e" ]
161+ script = ExtResource ("5_a0j4o" )
162+ script_inherits = "Area2D"
163+ block_serialization_trees = Array[ExtResource ("3_6j5ma" )]([SubResource ("Resource_jegfr" )])
164+ variables = Array[ExtResource ("6_yyx0f" )]([])
165+ generated_script = "extends Area2D
166+
167+
168+ func _init():
169+ body_entered.connect(_on_body_entered)
91170
171+ func _on_body_entered(something: Node2D):
172+
173+ if ((something).is_in_group('player')):
174+ (get_node(\" ../RigidBody2D/AnimationPlayer\" )).call('play_shake')
92175
93176"
94177version = 0
@@ -113,8 +196,17 @@ root_node = NodePath("../..")
113196libraries = {
114197"" : SubResource ("AnimationLibrary_gae7a" )
115198}
116- autoplay = "RESET"
117199
118200[node name ="BlockCode" type ="Node" parent ="RigidBody2D/AnimationPlayer" ]
119201script = ExtResource ("2_xy6in" )
120202block_script = SubResource ("Resource_6q7jc" )
203+
204+ [node name ="Area2D" type ="Area2D" parent ="." ]
205+
206+ [node name ="CollisionShape2D" type ="CollisionShape2D" parent ="Area2D" ]
207+ position = Vector2 (0 , -4 )
208+ shape = SubResource ("RectangleShape2D_3ufhb" )
209+
210+ [node name ="BlockCode" type ="Node" parent ="Area2D" ]
211+ script = ExtResource ("2_xy6in" )
212+ block_script = SubResource ("Resource_cri4e" )
0 commit comments