1- [gd_scene load_steps =169 format =3 uid ="uid://bbwmxee7ukgul" ]
1+ [gd_scene load_steps =177 format =3 uid ="uid://bbwmxee7ukgul" ]
22
33[ext_resource type ="PackedScene" uid ="uid://ddx1cd5q6t61o" path ="res://addons/block_code/simple_nodes/simple_character/simple_character.tscn" id ="1_hrpwq" ]
44[ext_resource type ="Script" path ="res://addons/block_code/block_code_node/block_code.gd" id ="2_ewral" ]
88[ext_resource type ="Script" path ="res://addons/block_code/block_script_data/block_script_data.gd" id ="5_q37d3" ]
99[ext_resource type ="Texture2D" uid ="uid://dr8e0tvfxjy1f" path ="res://icon.svg" id ="7_a27o8" ]
1010
11- [sub_resource type ="Resource" id ="Resource_bq364 " ]
11+ [sub_resource type ="Resource" id ="Resource_uwmna " ]
1212script = ExtResource ("3_dpt5n" )
1313block_class = &"StatementBlock"
14- serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.290196 , 0.52549 , 0.835294 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Move with player 2 buttons, speed {speed: INT}" ], ["statement" , "velocity = Input.get_vector(\" player_2_left\" , \" player_2_right\" , \" player_2_up\" , \" player_2_down\" )*{speed}
15- move_and_slide()" ], ["param_input_strings" , {
16- "speed" : "600"
14+ serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.890196 , 0.0588235 , 0.752941 , 1 )], ["block_type" , 2 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Load file {file_path: STRING} as sound {name: STRING}" ], ["statement" , "var sound = AudioStreamPlayer.new()
15+ sound.name = {name}
16+ sound.set_stream(load({file_path}))
17+ add_child(sound)
18+ sound.set_owner(self)" ], ["param_input_strings" , {
19+ "file_path" : "res://test_game/test_audio.ogg" ,
20+ "name" : "testsound"
1721}]]
1822
19- [sub_resource type ="Resource" id ="Resource_y4nnw " ]
23+ [sub_resource type ="Resource" id ="Resource_5jnoq " ]
2024script = ExtResource ("2_pqvcj" )
21- serialized_block = SubResource ("Resource_bq364 " )
25+ serialized_block = SubResource ("Resource_uwmna " )
2226path_child_pairs = []
2327
24- [sub_resource type ="Resource" id ="Resource_a8l73" ]
25- script = ExtResource ("3_dpt5n" )
26- block_class = &"EntryBlock"
27- serialized_props = [["block_name" , "physics_process_block" ], ["label" , "EntryBlock" ], ["color" , Color (0.980392 , 0.34902 , 0.337255 , 1 )], ["block_type" , 2 ], ["position" , Vector2 (460 , 94 )], ["block_format" , "On Physics Process" ], ["statement" , "func _physics_process(delta):" ], ["param_input_strings" , {}]]
28-
29- [sub_resource type ="Resource" id ="Resource_cel1g" ]
30- script = ExtResource ("2_pqvcj" )
31- serialized_block = SubResource ("Resource_a8l73" )
32- path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_y4nnw" )]]
33-
34- [sub_resource type ="Resource" id ="Resource_xcbw7" ]
28+ [sub_resource type ="Resource" id ="Resource_2niad" ]
3529script = ExtResource ("3_dpt5n" )
3630block_class = &"StatementBlock"
3731serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.941176 , 0.764706 , 0 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Send signal {signal: STRING} to group {group: STRING}" ], ["statement" , "var signal_manager = get_tree().root.get_node_or_null(\" SignalManager\" )
@@ -41,67 +35,139 @@ if signal_manager:
4135"signal" : "will_hi"
4236}]]
4337
44- [sub_resource type ="Resource" id ="Resource_8fbr0 " ]
38+ [sub_resource type ="Resource" id ="Resource_hb8ii " ]
4539script = ExtResource ("2_pqvcj" )
46- serialized_block = SubResource ("Resource_xcbw7 " )
47- path_child_pairs = []
40+ serialized_block = SubResource ("Resource_2niad " )
41+ path_child_pairs = [[ NodePath ( "VBoxContainer/SnapPoint" ), SubResource ( "Resource_5jnoq" )] ]
4842
49- [sub_resource type ="Resource" id ="Resource_k0oqj " ]
43+ [sub_resource type ="Resource" id ="Resource_nfmdk " ]
5044script = ExtResource ("3_dpt5n" )
5145block_class = &"StatementBlock"
5246serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.941176 , 0.764706 , 0 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Add to group {group: STRING}" ], ["statement" , "add_to_group({group})" ], ["param_input_strings" , {
5347"group" : "Player"
5448}]]
5549
56- [sub_resource type ="Resource" id ="Resource_itbdf " ]
50+ [sub_resource type ="Resource" id ="Resource_kiuvv " ]
5751script = ExtResource ("2_pqvcj" )
58- serialized_block = SubResource ("Resource_k0oqj " )
59- path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_8fbr0 " )]]
52+ serialized_block = SubResource ("Resource_nfmdk " )
53+ path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_hb8ii " )]]
6054
61- [sub_resource type ="Resource" id ="Resource_mg1oj " ]
55+ [sub_resource type ="Resource" id ="Resource_4xja7 " ]
6256script = ExtResource ("3_dpt5n" )
6357block_class = &"StatementBlock"
6458serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.6 , 0.537255 , 0.87451 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "print {text: STRING}" ], ["statement" , "print({text})" ], ["param_input_strings" , {
6559"text" : "Hi Manuel!"
6660}]]
6761
68- [sub_resource type ="Resource" id ="Resource_3b5w0 " ]
62+ [sub_resource type ="Resource" id ="Resource_u6g84 " ]
6963script = ExtResource ("2_pqvcj" )
70- serialized_block = SubResource ("Resource_mg1oj " )
71- path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_itbdf " )]]
64+ serialized_block = SubResource ("Resource_4xja7 " )
65+ path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_kiuvv " )]]
7266
73- [sub_resource type ="Resource" id ="Resource_hu4fg " ]
67+ [sub_resource type ="Resource" id ="Resource_6xoyl " ]
7468script = ExtResource ("3_dpt5n" )
7569block_class = &"EntryBlock"
76- serialized_props = [["block_name" , "ready_block" ], ["label" , "EntryBlock" ], ["color" , Color (0.980392 , 0.34902 , 0.337255 , 1 )], ["block_type" , 2 ], ["position" , Vector2 (104 , 85 )], ["block_format" , "On Ready" ], ["statement" , "func _ready():" ], ["param_input_strings" , {}]]
70+ serialized_props = [["block_name" , "ready_block" ], ["label" , "EntryBlock" ], ["color" , Color (0.980392 , 0.34902 , 0.337255 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (84 , 33 )], ["block_format" , "On Ready" ], ["statement" , "func _ready():" ], ["param_input_strings" , {}]]
71+
72+ [sub_resource type ="Resource" id ="Resource_xdg8y" ]
73+ script = ExtResource ("2_pqvcj" )
74+ serialized_block = SubResource ("Resource_6xoyl" )
75+ path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_u6g84" )]]
76+
77+ [sub_resource type ="Resource" id ="Resource_7ot84" ]
78+ script = ExtResource ("3_dpt5n" )
79+ block_class = &"ParameterBlock"
80+ serialized_props = [["block_name" , "parameter_block" ], ["label" , "Param" ], ["color" , Color (0.439216 , 0.501961 , 0.564706 , 1 )], ["block_type" , 3 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Is action ui_right pressed" ], ["statement" , "Input.is_action_pressed(\" ui_right\" )" ], ["param_input_strings" , {}]]
7781
78- [sub_resource type ="Resource" id ="Resource_pyh8n " ]
82+ [sub_resource type ="Resource" id ="Resource_xyinc " ]
7983script = ExtResource ("2_pqvcj" )
80- serialized_block = SubResource ("Resource_hu4fg " )
81- path_child_pairs = [[ NodePath ( "VBoxContainer/SnapPoint" ), SubResource ( "Resource_3b5w0" )] ]
84+ serialized_block = SubResource ("Resource_7ot84 " )
85+ path_child_pairs = []
8286
83- [sub_resource type ="Resource" id ="Resource_j1v52" ]
87+ [sub_resource type ="Resource" id ="Resource_2ykxc" ]
88+ script = ExtResource ("3_dpt5n" )
89+ block_class = &"StatementBlock"
90+ serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.890196 , 0.0588235 , 0.752941 , 1 )], ["block_type" , 2 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Play the sound {name: STRING} with Volume dB {db: FLOAT} and Pitch Scale {pitch: FLOAT}" ], ["statement" , "var sound = find_child({name})
91+ sound.volume_db = {db}
92+ sound.pitch_scale = {pitch}
93+ sound.play()" ], ["param_input_strings" , {
94+ "db" : "0.0" ,
95+ "name" : "testsound" ,
96+ "pitch" : "1.0"
97+ }]]
98+
99+ [sub_resource type ="Resource" id ="Resource_s07iu" ]
100+ script = ExtResource ("2_pqvcj" )
101+ serialized_block = SubResource ("Resource_2ykxc" )
102+ path_child_pairs = []
103+
104+ [sub_resource type ="Resource" id ="Resource_tu70f" ]
105+ script = ExtResource ("3_dpt5n" )
106+ block_class = &"ControlBlock"
107+ serialized_props = [["block_name" , "control_block" ], ["label" , "Control Block" ], ["color" , Color (1 , 0.678431 , 0.462745 , 1 )], ["block_type" , 2 ], ["position" , Vector2 (0 , 0 )], ["block_formats" , ["if {cond: BOOL}" ]], ["statements" , ["if {cond}:" ]], ["param_input_strings_array" , [{
108+ "cond" : ""
109+ }]]]
110+
111+ [sub_resource type ="Resource" id ="Resource_2hh05" ]
112+ script = ExtResource ("2_pqvcj" )
113+ serialized_block = SubResource ("Resource_tu70f" )
114+ path_child_pairs = [[NodePath ("VBoxContainer/MarginContainer/Rows/Row0/RowHBoxContainer/RowHBox/ParameterInput0/SnapPoint" ), SubResource ("Resource_xyinc" )], [NodePath ("VBoxContainer/MarginContainer/Rows/SnapContainer0/SnapPoint" ), SubResource ("Resource_s07iu" )]]
115+
116+ [sub_resource type ="Resource" id ="Resource_iskmc" ]
117+ script = ExtResource ("3_dpt5n" )
118+ block_class = &"StatementBlock"
119+ serialized_props = [["block_name" , "statement_block" ], ["label" , "StatementBlock" ], ["color" , Color (0.290196 , 0.52549 , 0.835294 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (0 , 0 )], ["block_format" , "Move with player 2 buttons, speed {speed: INT}" ], ["statement" , "velocity = Input.get_vector(\" player_2_left\" , \" player_2_right\" , \" player_2_up\" , \" player_2_down\" )*{speed}
120+ move_and_slide()" ], ["param_input_strings" , {
121+ "speed" : "600"
122+ }]]
123+
124+ [sub_resource type ="Resource" id ="Resource_xmana" ]
125+ script = ExtResource ("2_pqvcj" )
126+ serialized_block = SubResource ("Resource_iskmc" )
127+ path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_2hh05" )]]
128+
129+ [sub_resource type ="Resource" id ="Resource_1yx4d" ]
130+ script = ExtResource ("3_dpt5n" )
131+ block_class = &"EntryBlock"
132+ serialized_props = [["block_name" , "physics_process_block" ], ["label" , "EntryBlock" ], ["color" , Color (0.980392 , 0.34902 , 0.337255 , 1 )], ["block_type" , 1 ], ["position" , Vector2 (79 , 270 )], ["block_format" , "On Physics Process" ], ["statement" , "func _physics_process(delta):" ], ["param_input_strings" , {}]]
133+
134+ [sub_resource type ="Resource" id ="Resource_eifs0" ]
135+ script = ExtResource ("2_pqvcj" )
136+ serialized_block = SubResource ("Resource_1yx4d" )
137+ path_child_pairs = [[NodePath ("VBoxContainer/SnapPoint" ), SubResource ("Resource_xmana" )]]
138+
139+ [sub_resource type ="Resource" id ="Resource_2hn5u" ]
84140script = ExtResource ("4_xt862" )
85- array = Array[ExtResource ("2_pqvcj" )]([SubResource ("Resource_cel1g " ), SubResource ("Resource_pyh8n " )])
141+ array = Array[ExtResource ("2_pqvcj" )]([SubResource ("Resource_xdg8y " ), SubResource ("Resource_eifs0 " )])
86142
87143[sub_resource type ="Resource" id ="Resource_l007i" ]
88144script = ExtResource ("5_q37d3" )
89145script_inherits = "SimpleCharacter"
90- block_trees = SubResource ("Resource_j1v52 " )
146+ block_trees = SubResource ("Resource_2hn5u " )
91147generated_script = "extends SimpleCharacter
92148
93149var VAR_DICT := {}
94150
95- func _physics_process(delta):
96- velocity = Input.get_vector(\" player_2_left\" , \" player_2_right\" , \" player_2_up\" , \" player_2_down\" )*600
97- move_and_slide()
98-
99151func _ready():
100152 print('Hi Manuel!')
101153 add_to_group('Player')
102154 var signal_manager = get_tree().root.get_node_or_null(\" SignalManager\" )
103155 if signal_manager:
104156 signal_manager.broadcast_signal('Player', 'will_hi')
157+ var sound = AudioStreamPlayer.new()
158+ sound.name = 'testsound'
159+ sound.set_stream(load('res://test_game/test_audio.ogg'))
160+ add_child(sound)
161+ sound.set_owner(self)
162+
163+ func _physics_process(delta):
164+ velocity = Input.get_vector(\" player_2_left\" , \" player_2_right\" , \" player_2_up\" , \" player_2_down\" )*600
165+ move_and_slide()
166+ if Input.is_action_pressed(\" ui_right\" ):
167+ var sound = find_child('testsound')
168+ sound.volume_db = 0.0
169+ sound.pitch_scale = 1.0
170+ sound.play()
105171
106172"
107173
0 commit comments