Skip to content

Commit 960e3ef

Browse files
committed
Split ship to separate scene
1 parent e7caa93 commit 960e3ef

File tree

2 files changed

+54
-49
lines changed

2 files changed

+54
-49
lines changed

game-06/main.tscn

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
[gd_scene load_steps=44 format=3 uid="uid://da28ei7q3d34p"]
1+
[gd_scene load_steps=39 format=3 uid="uid://da28ei7q3d34p"]
22

33
[ext_resource type="Texture2D" uid="uid://dtref83nk0xpi" path="res://game-06/graphics/alan-labisch-NJpQ85eQJDE-unsplash.jpg" id="1_1fkef"]
44
[ext_resource type="Texture2D" uid="uid://c2kmueth1qo3q" path="res://game-06/graphics/coin.png" id="2_bcxue"]
5-
[ext_resource type="Script" path="res://addons/block_code/simple_nodes/simple_character/simple_character.gd" id="3_7g8jp"]
5+
[ext_resource type="PackedScene" uid="uid://c45vpqedwbvcv" path="res://game-06/ship.tscn" id="3_43t81"]
66
[ext_resource type="Texture2D" uid="uid://sfab1iwfjhyc" path="res://game-06/graphics/obstacle.png" id="3_w1gab"]
7-
[ext_resource type="Texture2D" uid="uid://blq8smrhpgtpj" path="res://game-06/graphics/graphics.png" id="4_t01by"]
8-
[ext_resource type="Texture2D" uid="uid://depftaxuqu0sm" path="res://game-01/smoke-01.png" id="5_vt2cy"]
97
[ext_resource type="AudioStream" uid="uid://didvrv0ccn5f0" path="res://game-06/Sounds/Cyborg Ninja.mp3" id="6_2umo5"]
108
[ext_resource type="Script" path="res://addons/block_code/block_code_node/block_code.gd" id="6_by3km"]
119
[ext_resource type="Script" path="res://addons/block_code/serialization/block_serialization_tree.gd" id="7_8cvv3"]
@@ -14,13 +12,6 @@
1412
[ext_resource type="Script" path="res://addons/block_code/serialization/block_script_serialization.gd" id="9_a8xal"]
1513
[ext_resource type="Script" path="res://addons/block_code/code_generation/variable_definition.gd" id="10_pjdut"]
1614

17-
[sub_resource type="Curve" id="Curve_j0da6"]
18-
_data = [Vector2(0, 0.570571), 0.0, 0.0, 0, 0, Vector2(0.643836, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
19-
point_count = 3
20-
21-
[sub_resource type="Gradient" id="Gradient_b36ji"]
22-
colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 0)
23-
2415
[sub_resource type="Resource" id="Resource_df0lr"]
2516
script = ExtResource("8_an3ek")
2617
name = &"simplecharacter_move"
@@ -87,7 +78,7 @@ script = ExtResource("7_8cvv3")
8778
root = SubResource("Resource_lsm30")
8879
canvas_position = Vector2(75, 475)
8980

90-
[sub_resource type="Resource" id="Resource_0tpvx"]
81+
[sub_resource type="Resource" id="Resource_313rt"]
9182
script = ExtResource("9_a8xal")
9283
script_inherits = "SimpleCharacter"
9384
block_serialization_trees = Array[ExtResource("7_8cvv3")]([SubResource("Resource_wfux0"), SubResource("Resource_ggdi5")])
@@ -114,10 +105,6 @@ func _ready():
114105
"
115106
version = 0
116107

117-
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_babat"]
118-
radius = 19.0
119-
height = 70.0
120-
121108
[sub_resource type="RectangleShape2D" id="RectangleShape2D_s7voe"]
122109
size = Vector2(960, 20)
123110

@@ -254,40 +241,11 @@ position = Vector2(413.597, 305.681)
254241
scale = Vector2(0.147097, 0.147097)
255242
texture = ExtResource("2_bcxue")
256243

257-
[node name="SimpleCharacter" type="CharacterBody2D" parent="." groups=["affected_by_gravity"]]
258-
position = Vector2(157, 236)
259-
script = ExtResource("3_7g8jp")
260-
speed = Vector2(400, 400)
261-
262-
[node name="CPUParticles2D" type="CPUParticles2D" parent="SimpleCharacter"]
263-
position = Vector2(-54, -7)
264-
amount = 30
265-
texture = ExtResource("5_vt2cy")
266-
direction = Vector2(-1, 0)
267-
spread = 0.0
268-
gravity = Vector2(-40, 0)
269-
initial_velocity_min = 79.27
270-
initial_velocity_max = 176.83
271-
scale_amount_min = 0.3
272-
scale_amount_max = 0.6
273-
scale_amount_curve = SubResource("Curve_j0da6")
274-
color_ramp = SubResource("Gradient_b36ji")
275-
276-
[node name="Sprite2D" type="Sprite2D" parent="SimpleCharacter"]
277-
position = Vector2(-8, -6)
278-
scale = Vector2(0.194135, 0.194135)
279-
texture = ExtResource("4_t01by")
280-
region_enabled = true
281-
region_rect = Rect2(338.878, 351.521, 753.301, 389.432)
282-
283-
[node name="BlockCode" type="Node" parent="SimpleCharacter"]
284-
script = ExtResource("6_by3km")
285-
block_script = SubResource("Resource_0tpvx")
244+
[node name="Ship" parent="." instance=ExtResource("3_43t81")]
286245

287-
[node name="CollisionShape2D" type="CollisionShape2D" parent="SimpleCharacter"]
288-
position = Vector2(3, -4)
289-
rotation = -1.57079
290-
shape = SubResource("CapsuleShape2D_babat")
246+
[node name="BlockCode" type="Node" parent="Ship"]
247+
script = ExtResource("6_by3km")
248+
block_script = SubResource("Resource_313rt")
291249

292250
[node name="Walls" type="StaticBody2D" parent="."]
293251

game-06/ship.tscn

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[gd_scene load_steps=7 format=3 uid="uid://c45vpqedwbvcv"]
2+
3+
[ext_resource type="Script" path="res://addons/block_code/simple_nodes/simple_character/simple_character.gd" id="1_rrros"]
4+
[ext_resource type="Texture2D" uid="uid://depftaxuqu0sm" path="res://game-01/smoke-01.png" id="2_3qwko"]
5+
[ext_resource type="Texture2D" uid="uid://blq8smrhpgtpj" path="res://game-06/graphics/graphics.png" id="3_s1qof"]
6+
7+
[sub_resource type="Curve" id="Curve_j0da6"]
8+
_data = [Vector2(0, 0.570571), 0.0, 0.0, 0, 0, Vector2(0.643836, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
9+
point_count = 3
10+
11+
[sub_resource type="Gradient" id="Gradient_b36ji"]
12+
colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 0)
13+
14+
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_babat"]
15+
radius = 19.0
16+
height = 70.0
17+
18+
[node name="SimpleCharacter" type="CharacterBody2D" groups=["affected_by_gravity"]]
19+
position = Vector2(157, 236)
20+
script = ExtResource("1_rrros")
21+
speed = Vector2(400, 400)
22+
23+
[node name="CPUParticles2D" type="CPUParticles2D" parent="."]
24+
position = Vector2(-54, -7)
25+
amount = 30
26+
texture = ExtResource("2_3qwko")
27+
direction = Vector2(-1, 0)
28+
spread = 0.0
29+
gravity = Vector2(-40, 0)
30+
initial_velocity_min = 79.27
31+
initial_velocity_max = 176.83
32+
scale_amount_min = 0.3
33+
scale_amount_max = 0.6
34+
scale_amount_curve = SubResource("Curve_j0da6")
35+
color_ramp = SubResource("Gradient_b36ji")
36+
37+
[node name="Sprite2D" type="Sprite2D" parent="."]
38+
position = Vector2(-8, -6)
39+
scale = Vector2(0.194135, 0.194135)
40+
texture = ExtResource("3_s1qof")
41+
region_enabled = true
42+
region_rect = Rect2(338.878, 351.521, 753.301, 389.432)
43+
44+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
45+
position = Vector2(3, -4)
46+
rotation = -1.57079
47+
shape = SubResource("CapsuleShape2D_babat")

0 commit comments

Comments
 (0)