Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add track prefabs and levels 2 & 3 #23

Merged
merged 7 commits into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/green_bulb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/green_bulb.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dscmmkun43x73"
path="res://.godot/imported/green_bulb.png-40142b1c42f713f5ea15a2bdd2f3b4da.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/green_bulb.png"
dest_files=["res://.godot/imported/green_bulb.png-40142b1c42f713f5ea15a2bdd2f3b4da.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added assets/red_bulb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/red_bulb.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c2bku7ypsu0q3"
path="res://.godot/imported/red_bulb.png-2510e07db82f9ed84f012733bc27ce16.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/red_bulb.png"
dest_files=["res://.godot/imported/red_bulb.png-2510e07db82f9ed84f012733bc27ce16.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
21 changes: 21 additions & 0 deletions prefabs/SignalButton.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[gd_scene load_steps=5 format=3 uid="uid://iw1demrx5nvt"]

[ext_resource type="Texture2D" uid="uid://c2bku7ypsu0q3" path="res://assets/red_bulb.png" id="1_l1i5j"]
[ext_resource type="Texture2D" uid="uid://dscmmkun43x73" path="res://assets/green_bulb.png" id="2_rqf3p"]

[sub_resource type="Theme" id="Theme_3hp74"]
CheckButton/icons/checked = ExtResource("1_l1i5j")
CheckButton/icons/unchecked = ExtResource("2_rqf3p")

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7ypl7"]

[node name="SignalButton" type="CheckButton"]
offset_right = 524.0
offset_bottom = 520.0
rotation = -1.5708
scale = Vector2(0.05, 0.05)
theme = SubResource("Theme_3hp74")
theme_override_styles/focus = SubResource("StyleBoxEmpty_7ypl7")
keep_pressed_outside = true
shortcut_in_tooltip = false
metadata/_edit_use_anchors_ = true
37 changes: 25 additions & 12 deletions prefabs/Track.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=8 format=3 uid="uid://d1xy67euifbh6"]
[gd_scene load_steps=9 format=3 uid="uid://d1xy67euifbh6"]

[ext_resource type="Script" path="res://scripts/Track.gd" id="1_ibb4y"]
[ext_resource type="Texture2D" uid="uid://dyk30b1nt2gvq" path="res://assets/crosstie.png" id="2_hrp4r"]
[ext_resource type="PackedScene" uid="uid://btfdanletw1gi" path="res://prefabs/TrackJunction.tscn" id="3_el8rw"]
[ext_resource type="PackedScene" uid="uid://iw1demrx5nvt" path="res://prefabs/SignalButton.tscn" id="4_t21tl"]
[ext_resource type="Texture2D" uid="uid://dlgfnj8p01ym4" path="res://assets/track.png" id="4_tum5x"]

[sub_resource type="Curve2D" id="Curve2D_nxaiu"]
@@ -54,13 +55,17 @@ loop = false
parent = NodePath("../..")
side = 2

[node name="SignalButton" type="CheckButton" parent="HeadPoint"]
[node name="SignalButton" parent="HeadPoint" instance=ExtResource("4_t21tl")]
visible = false
offset_top = 14.0
offset_right = 44.0
offset_bottom = 38.0
shortcut_in_tooltip = false
metadata/_edit_use_anchors_ = true
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_top = -15.0
offset_bottom = 505.0
grow_horizontal = 2
grow_vertical = 2

[node name="TailPoint" type="PathFollow2D" parent="."]
position = Vector2(256, 2.08165e-12)
@@ -71,12 +76,20 @@ loop = false
parent = NodePath("../..")
side = 3

[node name="SignalButton" type="CheckButton" parent="TailPoint"]
[node name="SignalButton" parent="TailPoint" instance=ExtResource("4_t21tl")]
visible = false
offset_left = -44.0
offset_top = 14.0
offset_bottom = 38.0
metadata/_edit_use_anchors_ = true
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_top = 15.0
offset_bottom = 535.0
grow_horizontal = 2
grow_vertical = 2
rotation = 1.5708
size_flags_horizontal = 4
size_flags_vertical = 4

[node name="TrackLine" type="Line2D" parent="."]
z_index = 2
20 changes: 4 additions & 16 deletions prefabs/TrackSwitch.tscn
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
[ext_resource type="Texture2D" uid="uid://bk10alqlk6ie2" path="res://assets/switch_left.png" id="4_xc4rb"]
[ext_resource type="Texture2D" uid="uid://cfj6l27udpvr7" path="res://assets/arrow.png" id="6_nflxo"]

[sub_resource type="Curve2D" id="Curve2D_30ar5"]
[sub_resource type="Curve2D" id="Curve2D_rvp3s"]
resource_local_to_scene = true
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 2.08165e-12, 2.08165e-12, -24.017, 16.005, 24.017, -16.005, 64, -16, 0, 0, 0, 0, 128, -32)
@@ -32,7 +32,7 @@ instance_count = 13
mesh = SubResource("ArrayMesh_umy7o")
buffer = PackedFloat32Array(0.99808, 0.0619333, 0, 4.99647, -0.0619333, 0.99808, 0, -0.176236, 0.992584, 0.121559, 0, 14.9636, -0.121559, 0.992584, 0, -0.961502, 0.98391, 0.178663, 0, 24.872, -0.178663, 0.98391, 0, -2.30135, 0.969346, 0.2457, 0, 34.6786, -0.2457, 0.969346, 0, -4.24865, 0.94496, 0.327186, 0, 44.3185, -0.327186, 0.94496, 0, -6.89664, 0.901405, 0.432977, 0, 53.6711, -0.432977, 0.901405, 0, -10.4225, 0.847395, 0.530963, 0, 62.5187, -0.530963, 0.847395, 0, -15.0622, 0.910454, 0.413611, 0, 71.1488, -0.413611, 0.910454, 0, -20.1015, 0.949217, 0.314623, 0, 80.3623, -0.314623, 0.949217, 0, -23.9742, 0.971893, 0.235421, 0, 89.9171, -0.235421, 0.971893, 0, -26.9124, 0.985566, 0.169291, 0, 99.6749, -0.169291, 0.985566, 0, -29.0903, 0.993711, 0.111974, 0, 109.553, -0.111974, 0.993711, 0, -30.6376, 0.99852, 0.054383, 0, 119.503, -0.054383, 0.99852, 0, -31.6189)

[sub_resource type="Curve2D" id="Curve2D_xv1m5"]
[sub_resource type="Curve2D" id="Curve2D_74r7i"]
resource_local_to_scene = true
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 2.08165e-12, 2.08165e-12, -23.902, -16.064, 23.902, 16.064, 64, 16, 0, 0, 0, 0, 128, 32)
@@ -53,7 +53,7 @@ CheckButton/icons/unchecked = ExtResource("4_xc4rb")
script = ExtResource("1_ucgph")

[node name="LeftTrack" parent="." groups=["left_track"] instance=ExtResource("2_e5vto")]
curve = SubResource("Curve2D_30ar5")
curve = SubResource("Curve2D_rvp3s")

[node name="MultiMeshInstance2D" parent="LeftTrack" index="1"]
multimesh = SubResource("MultiMesh_m32f0")
@@ -64,9 +64,6 @@ rotation = -0.244979
[node name="TrackJunction" parent="LeftTrack/HeadPoint" index="0"]
parent = NodePath("../../..")

[node name="SignalButton" parent="LeftTrack/HeadPoint" index="1"]
visible = false

[node name="TailPoint" parent="LeftTrack" index="3"]
position = Vector2(128, -32)
rotation = -0.244979
@@ -76,9 +73,6 @@ progress = 133.506
parent = NodePath("../../..")
side = 0

[node name="SignalButton" parent="LeftTrack/TailPoint" index="1"]
visible = false

[node name="TrackLine" parent="LeftTrack" index="4"]
points = PackedVector2Array(2.08165e-12, 2.08165e-12, 1.76493, -0.031045, 6.62261, -0.249297, 10.0063, -0.487274, 13.9174, -0.842432, 18.2738, -1.33823, 22.9936, -1.99813, 25.4642, -2.39694, 27.9949, -2.84558, 30.5755, -3.34697, 33.1957, -3.90405, 35.8452, -4.51975, 38.514, -5.197, 41.1916, -5.93874, 43.8678, -6.74789, 46.5325, -7.62739, 49.1753, -8.58017, 51.7861, -9.60917, 54.3545, -10.7173, 56.8703, -11.9075, 59.3234, -13.1828, 61.7033, -14.5459, 64, -16, 66.2967, -17.4541, 68.6766, -18.8172, 71.1297, -20.0925, 73.6455, -21.2827, 76.2139, -22.3908, 78.8247, -23.4198, 81.4675, -24.3726, 84.1322, -25.2521, 86.8084, -26.0613, 89.486, -26.803, 92.1548, -27.4802, 94.8044, -28.0959, 97.4245, -28.653, 100.005, -29.1544, 102.536, -29.6031, 105.006, -30.0019, 109.726, -30.6618, 114.083, -31.1576, 117.994, -31.5127, 121.377, -31.7507, 126.235, -31.969, 128, -32)
metadata/_edit_lock_ = true
@@ -95,7 +89,7 @@ texture = ExtResource("6_nflxo")

[node name="RightTrack" parent="." groups=["right_track"] instance=ExtResource("2_e5vto")]
z_index = 1
curve = SubResource("Curve2D_xv1m5")
curve = SubResource("Curve2D_74r7i")

[node name="MultiMeshInstance2D" parent="RightTrack" index="1"]
multimesh = SubResource("MultiMesh_pixd6")
@@ -106,9 +100,6 @@ rotation = 0.244979
[node name="TrackJunction" parent="RightTrack/HeadPoint" index="0"]
parent = NodePath("../../..")

[node name="SignalButton" parent="RightTrack/HeadPoint" index="1"]
visible = false

[node name="TailPoint" parent="RightTrack" index="3"]
position = Vector2(128, 32)
rotation = 0.244979
@@ -118,9 +109,6 @@ progress = 133.535
parent = NodePath("../../..")
side = 1

[node name="SignalButton" parent="RightTrack/TailPoint" index="1"]
visible = false

[node name="TrackLine" parent="RightTrack" index="4"]
points = PackedVector2Array(2.08165e-12, 2.08165e-12, 1.76964, 0.028625, 6.63878, 0.241, 10.0295, 0.475391, 13.9477, 0.826875, 18.311, 1.31917, 23.0368, 1.976, 25.5098, 2.37353, 28.0427, 2.82108, 30.6249, 3.32162, 33.2462, 3.87813, 35.8963, 4.49355, 38.5649, 5.17086, 41.2417, 5.91302, 43.9163, 6.723, 46.5786, 7.60376, 49.218, 8.55827, 51.8245, 9.58948, 54.3875, 10.7004, 56.8969, 11.8939, 59.3423, 13.173, 61.7135, 14.5408, 64, 16, 66.2865, 17.4592, 68.6577, 18.827, 71.1031, 20.1061, 73.6125, 21.2996, 76.1756, 22.4105, 78.782, 23.4417, 81.4214, 24.3962, 84.0837, 25.277, 86.7583, 26.087, 89.4351, 26.8291, 92.1037, 27.5065, 94.7538, 28.1219, 97.3751, 28.6784, 99.9574, 29.1789, 102.49, 29.6265, 104.963, 30.024, 109.689, 30.6808, 114.052, 31.1731, 117.97, 31.5246, 121.361, 31.759, 126.23, 31.9714, 128, 32)
metadata/_edit_lock_ = true
90 changes: 90 additions & 0 deletions prefabs/TrackSwitches/TrackSwitch_Left45Curve_Right45Curve.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[gd_scene load_steps=7 format=3 uid="uid://dv0rp1nuh5ves"]

[ext_resource type="PackedScene" uid="uid://bm5dq3lcopsvl" path="res://prefabs/TrackSwitch.tscn" id="1_ngsqx"]

[sub_resource type="Curve2D" id="Curve2D_81xyj"]
resource_local_to_scene = true
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 2.08165e-12, 2.08165e-12, 0, 0, 0, 0, 8, 0, -15.9099, 15.5564, 15.9099, -15.5564, 56, -16, 0, 0, 0, 0, 80, -40, 0, 0, 0, 0, 88, -48)
}
point_count = 5

[sub_resource type="ArrayMesh" id="ArrayMesh_umy7o"]
_surfaces = [{
"2d": true,
"aabb": AABB(-1.5, -13.5, 0, 3.00001, 27, 0),
"attribute_data": PackedByteArray(0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0),
"format": 33558545,
"index_count": 6,
"index_data": PackedByteArray(3, 0, 0, 0, 1, 0, 1, 0, 2, 0, 3, 0),
"primitive": 3,
"vertex_count": 4,
"vertex_data": PackedByteArray(0, 0, 192, 63, 0, 0, 88, 65, 0, 0, 192, 191, 0, 0, 88, 65, 0, 0, 192, 191, 0, 0, 88, 193, 0, 0, 192, 63, 0, 0, 88, 193)
}]

[sub_resource type="MultiMesh" id="MultiMesh_55w7u"]
resource_local_to_scene = true
instance_count = 10
mesh = SubResource("ArrayMesh_umy7o")
buffer = PackedFloat32Array(0.999839, 0.017918, 0, 5, -0.017918, 0.999839, 0, 7.80619e-13, 0.992192, 0.124719, 0, 14.9817, -0.124719, 0.992192, 0, -0.483443, 0.977357, 0.211598, 0, 24.87, -0.211598, 0.977357, 0, -1.94847, 0.945591, 0.325357, 0, 34.5727, -0.325357, 0.945591, 0, -4.34477, 0.884774, 0.46602, 0, 43.8991, -0.46602, 0.884774, 0, -7.92321, 0.758262, 0.65195, 0, 52.485, -0.65195, 0.758262, 0, -13.0107, 0.712023, 0.702156, 0, 59.8432, -0.702156, 0.712023, 0, -19.7698, 0.707563, 0.70665, 0, 66.9529, -0.70665, 0.707563, 0, -26.802, 0.701098, 0.713065, 0, 74.0144, -0.713065, 0.701098, 0, -33.8826, 0.707107, 0.707106, 0, 81.0192, -0.707106, 0.707107, 0, -41.0192)

[sub_resource type="Curve2D" id="Curve2D_jf8fx"]
resource_local_to_scene = true
_data = {
"points": PackedVector2Array(0, 0, 0, 0, 2.08165e-12, 2.08165e-12, 0, 0, 0, 0, 8, 0, -15.9491, -15.9704, 15.9491, 15.9704, 56, 16, 0, 0, 0, 0, 80, 40, 0, 0, 0, 0, 88, 48)
}
point_count = 5

[sub_resource type="MultiMesh" id="MultiMesh_n0m24"]
resource_local_to_scene = true
instance_count = 10
mesh = SubResource("ArrayMesh_umy7o")
buffer = PackedFloat32Array(0.999912, -0.0132958, 0, 5, 0.0132958, 0.999912, 0, 7.80619e-13, 0.993157, -0.116789, 0, 14.9862, 0.116789, 0.993157, 0, 0.410031, 0.978234, -0.207504, 0, 24.8843, 0.207504, 0.978234, 0, 1.80522, 0.945319, -0.326147, 0, 34.5931, 0.326147, 0.945319, 0, 4.1747, 0.88189, -0.471456, 0, 43.911, 0.471456, 0.88189, 0, 7.77285, 0.752086, -0.659065, 0, 52.4581, 0.659065, 0.752086, 0, 12.9232, 0.706809, -0.707405, 0, 59.7496, 0.707405, 0.706809, 0, 19.7539, 0.707076, -0.707138, 0, 66.8183, 0.707138, 0.707076, 0, 26.8274, 0.707461, -0.706752, 0, 73.8899, 0.706752, 0.707461, 0, 33.8979, 0.707107, -0.707107, 0, 80.965, 0.707107, 0.707107, 0, 40.965)

[node name="TrackSwitch" instance=ExtResource("1_ngsqx")]

[node name="LeftTrack" parent="." index="0"]
curve = SubResource("Curve2D_81xyj")

[node name="MultiMeshInstance2D" parent="LeftTrack" index="1"]
multimesh = SubResource("MultiMesh_55w7u")

[node name="HeadPoint" parent="LeftTrack" index="2"]
rotation = -2.60206e-13

[node name="TailPoint" parent="LeftTrack" index="3"]
position = Vector2(88, -48)
rotation = -0.785398
progress = 104.872

[node name="TrackLine" parent="LeftTrack" index="4"]
points = PackedVector2Array(2.08165e-12, 2.08165e-12, 4, 1.04082e-12, 8, 0, 9.40995, -0.0494466, 13.2627, -0.312388, 15.9283, -0.577639, 18.9925, -0.960728, 22.3846, -1.48314, 26.0338, -2.16637, 29.8694, -3.0319, 33.8208, -4.10121, 37.8173, -5.39581, 41.788, -6.93716, 45.6624, -8.74677, 49.3696, -10.8461, 52.8391, -13.2567, 56, -16, 58.8914, -18.8331, 61.5991, -21.4976, 64.1228, -23.9915, 66.462, -26.3128, 68.6163, -28.4597, 70.5854, -30.43, 73.9662, -33.8336, 76.6012, -36.508, 78.4873, -38.4376, 80, -40, 81.25, -41.25, 84, -44, 86.75, -46.75, 88, -48)

[node name="Pointer" parent="LeftTrack" index="5"]
position = Vector2(50.4061, -11.515)
progress = 52.4362

[node name="RightTrack" parent="." index="1"]
curve = SubResource("Curve2D_jf8fx")

[node name="MultiMeshInstance2D" parent="RightTrack" index="1"]
multimesh = SubResource("MultiMesh_n0m24")

[node name="HeadPoint" parent="RightTrack" index="2"]
rotation = -2.60206e-13

[node name="TailPoint" parent="RightTrack" index="3"]
position = Vector2(88, 48)
rotation = 0.785398
progress = 104.949

[node name="TrackLine" parent="RightTrack" index="4"]
points = PackedVector2Array(2.08165e-12, 2.08165e-12, 4, 1.04082e-12, 8, 0, 9.40834, 0.0324641, 13.2572, 0.254163, 15.9204, 0.494243, 18.9822, 0.851555, 22.3719, 1.3494, 26.0191, 2.0111, 29.8532, 2.85995, 33.8036, 3.91926, 37.7999, 5.21234, 41.7715, 6.76249, 45.6478, 8.59302, 49.3584, 10.7272, 52.8326, 13.1885, 56, 16, 58.8979, 18.9014, 61.6104, 21.6165, 64.1373, 24.1453, 66.4785, 26.4875, 68.6337, 28.6431, 70.6026, 30.612, 73.9809, 33.9889, 76.6116, 36.6172, 78.4928, 38.4958, 80, 40, 81.25, 41.25, 84, 44, 86.75, 46.75, 88, 48)

[node name="Pointer" parent="RightTrack" index="5"]
position = Vector2(50.4243, 11.4282)
rotation = 0.597223
progress = 52.4745

[editable path="LeftTrack"]
[editable path="RightTrack"]
Loading