File tree Expand file tree Collapse file tree 6 files changed +44
-7
lines changed
addons/block_code/simple_nodes Expand file tree Collapse file tree 6 files changed +44
-7
lines changed Original file line number Diff line number Diff line change 1+ @tool
2+ extends SimpleCharacter
3+
4+
5+ func _init ():
6+ # Disable the SimpleCharacter _init function. We expect this script is
7+ # already bound to _simple_character.tscn.
8+ pass
Original file line number Diff line number Diff line change 11[gd_scene load_steps =3 format =3 uid ="uid://ddx1cd5q6t61o" ]
22
3- [ext_resource type ="Script" path ="res://addons/block_code/simple_nodes/simple_character/simple_character .gd" id ="1_oqwef " ]
3+ [ext_resource type ="Script" path ="res://addons/block_code/simple_nodes/simple_character/_simple_character .gd" id ="1_idjqv " ]
44
5- [sub_resource type ="RectangleShape2D" id ="RectangleShape2D_104qs " ]
6- size = Vector2 (16 , 16 )
5+ [sub_resource type ="RectangleShape2D" id ="RectangleShape2D_ffh0f " ]
6+ size = Vector2 (100 , 100 )
77
88[node name ="SimpleCharacter" type ="CharacterBody2D" ]
9- script = ExtResource ("1_oqwef " )
9+ script = ExtResource ("1_idjqv " )
1010
1111[node name ="Sprite2D" type ="Sprite2D" parent ="." ]
1212
1313[node name ="CollisionShape2D" type ="CollisionShape2D" parent ="." ]
14- shape = SubResource ("RectangleShape2D_104qs " )
14+ shape = SubResource ("RectangleShape2D_ffh0f " )
Original file line number Diff line number Diff line change @@ -52,6 +52,16 @@ func on_gravity_changed(new_gravity):
5252 gravity = new_gravity
5353
5454
55+ func _init ():
56+ if self .get_parent ():
57+ return
58+
59+ var node = preload ("res://addons/block_code/simple_nodes/simple_character/_simple_character.tscn" ).instantiate () as Node
60+ node .replace_by (self , true )
61+ node .queue_free ()
62+ scene_file_path = ""
63+
64+
5565func _ready ():
5666 add_to_group ("affected_by_gravity" )
5767 simple_setup ()
Original file line number Diff line number Diff line change 1+ @tool
2+ extends SimpleScoring
3+
4+
5+ func _init ():
6+ # Disable the SimpleScoring _init function. We expect this script is
7+ # already bound to _simple_scoring.tscn.
8+ pass
Original file line number Diff line number Diff line change 11[gd_scene load_steps =2 format =3 uid ="uid://bis7afjjuwypq" ]
22
3- [ext_resource type ="Script" path ="res://addons/block_code/simple_nodes/simple_scoring/simple_scoring .gd" id ="1_yyb01 " ]
3+ [ext_resource type ="Script" path ="res://addons/block_code/simple_nodes/simple_scoring/_simple_scoring .gd" id ="1_lc5bg " ]
44
55[node name ="SimpleScoring" type ="CanvasLayer" groups =["hud" ]]
6- script = ExtResource ("1_yyb01 " )
6+ script = ExtResource ("1_lc5bg " )
77
88[node name ="PlayerLeftScore" type ="Label" parent ="." ]
99unique_name_in_owner = true
Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ const _POSITIONS_FOR_PLAYER = {
1919}
2020
2121
22+ func _init ():
23+ if self .get_parent ():
24+ return
25+
26+ var node = preload ("res://addons/block_code/simple_nodes/simple_scoring/_simple_scoring.tscn" ).instantiate () as Node
27+ node .replace_by (self , true )
28+ node .queue_free ()
29+ print_tree_pretty ()
30+ scene_file_path = ""
31+
32+
2233func get_custom_class ():
2334 return "SimpleScoring"
2435
You can’t perform that action at this time.
0 commit comments