godot-shooter / commit
Reorganization, mostly renames of nodes in World.
Trails.tscn | 6 +----- World.gd | 2 +- World.tscn | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Trails.tscn b/Trails.tscn index 128d142..9439c91 100644 --- a/Trails.tscn +++ b/Trails.tscn @@ -1,13 +1,10 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://Trails.gd" type="Script" id=1] [sub_resource type="Curve" id=1] _data = [ Vector2( 0, 0.220721 ), 0.0, -0.0409159, 0, 0, Vector2( 0.781651, 0.243243 ), 0.0, 0.0, 0, 0, Vector2( 1, 1 ), 0.0, 0.0, 0, 0 ] -[sub_resource type="Gradient" id=2] -colors = PoolColorArray( 1, 1, 1, 0, 1, 1, 1, 1 ) - [node name="Node2D" type="Node2D"] script = ExtResource( 1 ) @@ -20,4 +17,3 @@ modulate = Color( 1, 1, 1, 0.670588 ) rotation = -0.000165944 width_curve = SubResource( 1 ) default_color = Color( 0.4, 0.501961, 1, 1 ) -gradient = SubResource( 2 ) diff --git a/World.gd b/World.gd index 513055a..a4b7efc 100644 --- a/World.gd +++ b/World.gd @@ -13,7 +13,7 @@ var min_items_dict = { } func enemy_killed(): - $CanvasLayer/HUD.score += 1 + $UI/HUD.score += 1 func create_enemy(): var enemy = Enemy.instance() diff --git a/World.tscn b/World.tscn index 728da29..a249a40 100644 --- a/World.tscn +++ b/World.tscn @@ -13,9 +13,6 @@ radius = 29.0172 [node name="World" type="Node2D"] script = ExtResource( 4 ) -[node name="Player" parent="." groups=["player"] instance=ExtResource( 2 )] -position = Vector2( 248, 410 ) - [node name="Destination" type="Area2D" parent="."] [node name="XSprite" type="Sprite" parent="Destination"] @@ -25,17 +22,17 @@ texture = ExtResource( 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="Destination"] shape = SubResource( 1 ) -[node name="CanvasLayer2" type="CanvasLayer" parent="."] +[node name="Background" type="CanvasLayer" parent="."] -[node name="ParallaxBackground" type="ParallaxBackground" parent="CanvasLayer2"] +[node name="ParallaxBackground" type="ParallaxBackground" parent="Background"] scroll_ignore_camera_zoom = true -[node name="Foreground" type="ParallaxLayer" parent="CanvasLayer2/ParallaxBackground"] +[node name="Foreground" type="ParallaxLayer" parent="Background/ParallaxBackground"] motion_mirroring = Vector2( 2048, 1200 ) -[node name="StarField" parent="CanvasLayer2/ParallaxBackground/Foreground" instance=ExtResource( 5 )] +[node name="StarField" parent="Background/ParallaxBackground/Foreground" instance=ExtResource( 5 )] -[node name="Background" type="ParallaxLayer" parent="CanvasLayer2/ParallaxBackground"] +[node name="Background" type="ParallaxLayer" parent="Background/ParallaxBackground"] visible = false modulate = Color( 1, 1, 1, 0.501961 ) motion_scale = Vector2( 0.8, 0.8 ) @@ -44,21 +41,24 @@ __meta__ = { "_edit_group_": true } -[node name="StarField2" parent="CanvasLayer2/ParallaxBackground/Background" instance=ExtResource( 5 )] +[node name="StarField2" parent="Background/ParallaxBackground/Background" instance=ExtResource( 5 )] visible = false +[node name="Player" parent="." groups=["player"] instance=ExtResource( 2 )] +position = Vector2( 248, 410 ) + [node name="Environment" type="Node2D" parent="."] -[node name="CanvasLayer" type="CanvasLayer" parent="."] +[node name="UI" type="CanvasLayer" parent="."] -[node name="HUD" parent="CanvasLayer" instance=ExtResource( 3 )] +[node name="HUD" parent="UI" instance=ExtResource( 3 )] pause_mode = 2 margin_left = -4.0 margin_top = -3.0 margin_right = -4.0 margin_bottom = -3.0 -[node name="PauseMenu" type="Control" parent="CanvasLayer"] +[node name="PauseMenu" type="Control" parent="UI"] pause_mode = 2 visible = false anchor_right = 1.0 @@ -67,26 +67,26 @@ margin_right = 40.0 margin_bottom = 40.0 mouse_filter = 2 -[node name="Panel" type="Panel" parent="CanvasLayer/PauseMenu"] +[node name="Panel" type="Panel" parent="UI/PauseMenu"] margin_left = 120.0 margin_top = 233.0 margin_right = 370.0 margin_bottom = 483.0 -[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/PauseMenu/Panel"] +[node name="VBoxContainer" type="VBoxContainer" parent="UI/PauseMenu/Panel"] margin_left = 68.0 margin_top = 72.0 margin_right = 132.0 margin_bottom = 110.0 -[node name="Label" type="Label" parent="CanvasLayer/PauseMenu/Panel/VBoxContainer"] +[node name="Label" type="Label" parent="UI/PauseMenu/Panel/VBoxContainer"] margin_right = 114.0 margin_bottom = 35.0 theme = ExtResource( 6 ) text = "Paused" align = 1 -[node name="Button" type="Button" parent="CanvasLayer/PauseMenu/Panel/VBoxContainer"] +[node name="Button" type="Button" parent="UI/PauseMenu/Panel/VBoxContainer"] margin_top = 39.0 margin_right = 114.0 margin_bottom = 80.0 @@ -111,5 +111,5 @@ round_precision = 13 antialiased = true [connection signal="body_entered" from="Destination" to="." method="_on_Destination_body_entered"] -[connection signal="pressed" from="CanvasLayer/PauseMenu/Panel/VBoxContainer/Button" to="." method="_on_Button_pressed"] +[connection signal="pressed" from="UI/PauseMenu/Panel/VBoxContainer/Button" to="." method="_on_Button_pressed"] [connection signal="timeout" from="ShootTimer" to="." method="_on_ShootTimer_timeout"]