1
- [gd_scene load_steps =169 format =3 uid ="uid://bbwmxee7ukgul" ]
1
+ [gd_scene load_steps =177 format =3 uid ="uid://bbwmxee7ukgul" ]
2
2
3
3
[ext_resource type ="PackedScene" uid ="uid://ddx1cd5q6t61o" path ="res://addons/block_code/simple_nodes/simple_character/simple_character.tscn" id ="1_hrpwq" ]
4
4
[ext_resource type ="Script" path ="res://addons/block_code/block_code_node/block_code.gd" id ="2_ewral" ]
8
8
[ext_resource type ="Script" path ="res://addons/block_code/block_script_data/block_script_data.gd" id ="5_q37d3" ]
9
9
[ext_resource type ="Texture2D" uid ="uid://dr8e0tvfxjy1f" path ="res://icon.svg" id ="7_a27o8" ]
10
10
11
- [sub_resource type ="Resource" id ="Resource_bq364 " ]
11
+ [sub_resource type ="Resource" id ="Resource_uwmna " ]
12
12
script = ExtResource ("3_dpt5n" )
13
13
block_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"
17
21
}]]
18
22
19
- [sub_resource type ="Resource" id ="Resource_y4nnw " ]
23
+ [sub_resource type ="Resource" id ="Resource_5jnoq " ]
20
24
script = ExtResource ("2_pqvcj" )
21
- serialized_block = SubResource ("Resource_bq364 " )
25
+ serialized_block = SubResource ("Resource_uwmna " )
22
26
path_child_pairs = []
23
27
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" ]
35
29
script = ExtResource ("3_dpt5n" )
36
30
block_class = &"StatementBlock"
37
31
serialized_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:
41
35
"signal" : "will_hi"
42
36
}]]
43
37
44
- [sub_resource type ="Resource" id ="Resource_8fbr0 " ]
38
+ [sub_resource type ="Resource" id ="Resource_hb8ii " ]
45
39
script = 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" )] ]
48
42
49
- [sub_resource type ="Resource" id ="Resource_k0oqj " ]
43
+ [sub_resource type ="Resource" id ="Resource_nfmdk " ]
50
44
script = ExtResource ("3_dpt5n" )
51
45
block_class = &"StatementBlock"
52
46
serialized_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" , {
53
47
"group" : "Player"
54
48
}]]
55
49
56
- [sub_resource type ="Resource" id ="Resource_itbdf " ]
50
+ [sub_resource type ="Resource" id ="Resource_kiuvv " ]
57
51
script = 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 " )]]
60
54
61
- [sub_resource type ="Resource" id ="Resource_mg1oj " ]
55
+ [sub_resource type ="Resource" id ="Resource_4xja7 " ]
62
56
script = ExtResource ("3_dpt5n" )
63
57
block_class = &"StatementBlock"
64
58
serialized_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" , {
65
59
"text" : "Hi Manuel!"
66
60
}]]
67
61
68
- [sub_resource type ="Resource" id ="Resource_3b5w0 " ]
62
+ [sub_resource type ="Resource" id ="Resource_u6g84 " ]
69
63
script = 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 " )]]
72
66
73
- [sub_resource type ="Resource" id ="Resource_hu4fg " ]
67
+ [sub_resource type ="Resource" id ="Resource_6xoyl " ]
74
68
script = ExtResource ("3_dpt5n" )
75
69
block_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" , {}]]
77
81
78
- [sub_resource type ="Resource" id ="Resource_pyh8n " ]
82
+ [sub_resource type ="Resource" id ="Resource_xyinc " ]
79
83
script = 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 = []
82
86
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" ]
84
140
script = 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 " )])
86
142
87
143
[sub_resource type ="Resource" id ="Resource_l007i" ]
88
144
script = ExtResource ("5_q37d3" )
89
145
script_inherits = "SimpleCharacter"
90
- block_trees = SubResource ("Resource_j1v52 " )
146
+ block_trees = SubResource ("Resource_2hn5u " )
91
147
generated_script = "extends SimpleCharacter
92
148
93
149
var VAR_DICT := {}
94
150
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
-
99
151
func _ready():
100
152
print('Hi Manuel!')
101
153
add_to_group('Player')
102
154
var signal_manager = get_tree().root.get_node_or_null(\" SignalManager\" )
103
155
if signal_manager:
104
156
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()
105
171
106
172
"
107
173
0 commit comments