chain levels with spaghetti
This commit is contained in:
parent
7a18c4f8c6
commit
6a59b54c11
10 changed files with 465 additions and 15 deletions
|
@ -1,18 +1,20 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://b0mhosbyt1fit"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://b0mhosbyt1fit"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://brwwlwb1rpro7" path="res://levels/base/material.tres" id="1_dwsqy"]
|
||||
[ext_resource type="Material" uid="uid://brwwlwb1rpro7" path="res://graphics/unhappy_material.tres" id="1_dwsqy"]
|
||||
[ext_resource type="PackedScene" uid="uid://ygvokp5f78i5" path="res://levels/base/environment.tscn" id="1_n7fd8"]
|
||||
[ext_resource type="Script" path="res://levels/level.gd" id="1_rj40i"]
|
||||
[ext_resource type="PackedScene" uid="uid://cnnvwotv33u1b" path="res://elements/player.tscn" id="2_b00jj"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpm3laywhlbq5" path="res://elements/ring.tscn" id="3_hel5x"]
|
||||
[ext_resource type="PackedScene" uid="uid://c77bli40240nk" path="res://elements/sign.tscn" id="4_atq6y"]
|
||||
|
||||
[node name="Level" type="Node3D"]
|
||||
metadata/name = "base"
|
||||
[node name="Base" type="Node3D"]
|
||||
script = ExtResource("1_rj40i")
|
||||
metadata/material = ExtResource("1_dwsqy")
|
||||
|
||||
[node name="Environment" parent="." instance=ExtResource("1_n7fd8")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_b00jj")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13.2075, 0)
|
||||
|
||||
[node name="Signs" type="Node3D" parent="."]
|
||||
transform = Transform3D(-1, 8.74228e-08, 0, -8.74228e-08, -1, 0, 0, 0, 1, -366.478, 20.7111, -61.4153)
|
||||
|
@ -24,6 +26,13 @@ transform = Transform3D(-1, -8.74228e-08, 0, 8.74228e-08, -1, 0, 0, 0, 1, -366.4
|
|||
text = "Press the arrow keys
|
||||
to change the gravity!"
|
||||
|
||||
[node name="Sign7" parent="Signs" instance=ExtResource("4_atq6y")]
|
||||
transform = Transform3D(4.37114e-08, -7.10543e-15, -1, -8.74228e-08, -1, 0, -1, 8.74228e-08, -4.37114e-08, 150, 40, 61)
|
||||
|
||||
[node name="Text" parent="Signs/Sign7" index="0"]
|
||||
text = "SLOW DOWN!!"
|
||||
font_size = 2056
|
||||
|
||||
[node name="Sign2" parent="Signs" instance=ExtResource("4_atq6y")]
|
||||
transform = Transform3D(-1, -8.74228e-08, 0, 8.74228e-08, -1, 0, 0, 0, 1, -234.9, 2.09808e-05, 0)
|
||||
|
||||
|
@ -43,7 +52,7 @@ transform = Transform3D(-4.37114e-08, 8.74228e-08, 1, 0, -1, 8.74228e-08, 1, 3.8
|
|||
|
||||
[node name="Text" parent="Signs/Sign5" index="0"]
|
||||
text = "The level is over once
|
||||
you get all rings!"
|
||||
you get all the rings!"
|
||||
|
||||
[node name="Sign6" parent="Signs" instance=ExtResource("4_atq6y")]
|
||||
transform = Transform3D(-0.707107, 6.18172e-08, 0.707107, -8.74228e-08, -1, 0, 0.707107, -6.18172e-08, 0.707107, -532.475, 18.0064, 60)
|
||||
|
@ -116,6 +125,7 @@ transform = Transform3D(0.0172464, 0.899835, 0, -0.899835, 0.0172464, 0, 0, 0, 0
|
|||
transform = Transform3D(0.0114976, 0.59989, 0, -0.59989, 0.0114976, 0, 0, 0, 0.6, -414.274, 8.64172, 0)
|
||||
|
||||
[editable path="Signs/Sign"]
|
||||
[editable path="Signs/Sign7"]
|
||||
[editable path="Signs/Sign2"]
|
||||
[editable path="Signs/Sign4"]
|
||||
[editable path="Signs/Sign5"]
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://brwwlwb1rpro7"]
|
||||
|
||||
[resource]
|
||||
metallic = 1.0
|
24
levels/forest/environment.tscn
Normal file
24
levels/forest/environment.tscn
Normal file
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://w4h8ip754qnb"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_clvpw"]
|
||||
sky_top_color = Color(0, 0.504542, 0.579919, 1)
|
||||
sky_horizon_color = Color(9.62615e-08, 0.776269, 0.496436, 1)
|
||||
sky_curve = 0.219613
|
||||
ground_bottom_color = Color(0.078119, 0.275869, 4.81308e-08, 1)
|
||||
ground_horizon_color = Color(0.300489, 0.406247, 0.0024617, 1)
|
||||
sun_angle_max = 224.83
|
||||
sun_curve = 0.212132
|
||||
|
||||
[sub_resource type="Sky" id="Sky_8w3rf"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_clvpw")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_nda78"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_8w3rf")
|
||||
sky_rotation = Vector3(0.0872665, 0.698132, 0.0872665)
|
||||
ambient_light_source = 3
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
reflected_light_source = 2
|
||||
|
||||
[node name="Environment" type="WorldEnvironment"]
|
||||
environment = SubResource("Environment_nda78")
|
117
levels/forest/level.tscn
Normal file
117
levels/forest/level.tscn
Normal file
|
@ -0,0 +1,117 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://dfvuxfxc6ooya"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://w4h8ip754qnb" path="res://levels/forest/environment.tscn" id="1_7clrg"]
|
||||
[ext_resource type="Script" path="res://levels/level.gd" id="1_fdxcj"]
|
||||
[ext_resource type="PackedScene" uid="uid://cnnvwotv33u1b" path="res://elements/player.tscn" id="2_mjogx"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpm3laywhlbq5" path="res://elements/ring.tscn" id="4_p8yhq"]
|
||||
|
||||
[node name="Forest" type="Node3D"]
|
||||
script = ExtResource("1_fdxcj")
|
||||
|
||||
[node name="Environment" parent="." instance=ExtResource("1_7clrg")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_mjogx")]
|
||||
|
||||
[node name="Rings" type="Node3D" parent="."]
|
||||
|
||||
[node name="Ring" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, 0, -2, 0)
|
||||
|
||||
[node name="Ring2" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -3, 0)
|
||||
|
||||
[node name="Ring11" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(20, 0, 0, 0, 20, 0, 0, 0, 20, 0, 64.625, 0)
|
||||
|
||||
[node name="Ring26" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(20, 0, 0, 0, 20, 0, 0, 0, 20, -220.266, 264.294, 0)
|
||||
|
||||
[node name="Ring3" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-1.31134e-08, -0.3, 0, 0.3, -1.31134e-08, 0, 0, 0, 0.3, 5, -8, 0)
|
||||
|
||||
[node name="Ring4" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, 4, -8, 0)
|
||||
|
||||
[node name="Ring5" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-1.31134e-08, -0.3, 0, 0.3, -1.31134e-08, 0, 0, 0, 0.3, 20, -4, 0)
|
||||
|
||||
[node name="Ring6" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, 19, -4, 0)
|
||||
|
||||
[node name="Ring7" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-1.31134e-08, -0.3, 0, 0.3, -1.31134e-08, 0, 0, 0, 0.3, 39.2269, -8, 0)
|
||||
|
||||
[node name="Ring8" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, 38.2269, -8, 0)
|
||||
|
||||
[node name="Ring9" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-1.31134e-08, -0.3, 0, 0.3, -1.31134e-08, 0, 0, 0, 0.3, 54.2269, -4, 0)
|
||||
|
||||
[node name="Ring10" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, 53.227, -4, 0)
|
||||
|
||||
[node name="Ring12" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 78, 10, 0)
|
||||
|
||||
[node name="Ring14" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 42.708, 48.7486, 0)
|
||||
|
||||
[node name="Ring13" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, 64.1634, 30.568, 0)
|
||||
|
||||
[node name="Ring15" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, 9.73236, 65.3451, 0)
|
||||
|
||||
[node name="Ring16" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-2.18557e-08, -0.5, 0, 0.5, -2.18557e-08, 0, 0, 0, 0.5, -23.606, 88.7308, 0)
|
||||
|
||||
[node name="Ring17" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-8.74228e-08, -2, 0, 2, -8.74228e-08, 0, 0, 0, 2, -104.638, 112.884, 0)
|
||||
|
||||
[node name="Ring18" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-8.74228e-08, -2, 0, 2, -8.74228e-08, 0, 0, 0, 2, -452.906, 58.8928, 0)
|
||||
|
||||
[node name="Ring19" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-8.74228e-08, -2, 0, 2, -8.74228e-08, 0, 0, 0, 2, -742.534, 126.395, 0)
|
||||
|
||||
[node name="Ring20" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -1018.15, -27.6358, 0)
|
||||
|
||||
[node name="Ring21" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -1018.15, -66.5463, 0)
|
||||
|
||||
[node name="Ring22" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, -1018.15, -85.7121, 0)
|
||||
|
||||
[node name="Ring24" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-0.51303, -1.40954, 0, 1.40954, -0.51303, 0, 0, 0, 1.5, -1001.17, -87.6138, 0)
|
||||
|
||||
[node name="Ring25" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-3.0598e-08, -0.7, 0, 0.7, -3.0598e-08, 0, 0, 0, 0.7, -966.1, -87.6138, 0)
|
||||
|
||||
[node name="Ring27" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-5.24537e-08, -1.2, 0, 1.2, -5.24537e-08, 0, 0, 0, 1.2, -881.143, -72.4025, 0)
|
||||
|
||||
[node name="Ring28" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-5.24537e-08, -1.2, 0, 1.2, -5.24537e-08, 0, 0, 0, 1.2, -793.893, -58.0851, 0)
|
||||
|
||||
[node name="Ring29" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-5.24537e-08, -1.2, 0, 1.2, -5.24537e-08, 0, 0, 0, 1.2, -706.288, -35.6603, 0)
|
||||
|
||||
[node name="Ring30" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-5.24537e-08, -1.2, 0, 1.2, -5.24537e-08, 0, 0, 0, 1.2, -619.038, -21.3428, 0)
|
||||
|
||||
[node name="Ring31" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-5.24537e-08, -1.2, 0, 1.2, -5.24537e-08, 0, 0, 0, 1.2, -510.173, 3.82137, 0)
|
||||
|
||||
[node name="Ring32" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(-0.563606, -1.05941, 0, 1.05941, -0.563606, 0, 0, 0, 1.2, -416.969, 37.1114, 0)
|
||||
|
||||
[node name="Ring33" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(1.25802, 0.327712, 0, -0.327712, 1.25802, 0, 0, 0, 1.3, -289.057, 121.083, 0)
|
||||
|
||||
[node name="Ring34" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -218.208, 206.247, 0)
|
||||
|
||||
[node name="Ring23" parent="Rings" instance=ExtResource("4_p8yhq")]
|
||||
transform = Transform3D(0.939693, 0.34202, 0, -0.34202, 0.939693, 0, 0, 0, 1, -1018.15, -96.9134, 0)
|
22
levels/level.gd
Normal file
22
levels/level.gd
Normal file
|
@ -0,0 +1,22 @@
|
|||
extends Node3D
|
||||
|
||||
var rings_count = 72727
|
||||
var finished_rings_count = 0
|
||||
var rings: Array[Node] = []
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
var rings_node = get_node("Rings")
|
||||
assert(is_instance_valid(rings_node), self.name + " has no rings!")
|
||||
rings = rings_node.get_children()
|
||||
rings_count = len(rings)
|
||||
|
||||
for ring in rings:
|
||||
ring.connect("collect_signal", do_we_end_yet)
|
||||
|
||||
func do_we_end_yet():
|
||||
finished_rings_count += 1
|
||||
if finished_rings_count >= rings_count:
|
||||
var game = get_parent().get_parent()
|
||||
if is_instance_valid(game) and game.has_method("stop_level"):
|
||||
game.stop_level()
|
Loading…
Add table
Add a link
Reference in a new issue