many small changes, and few big ones

This commit is contained in:
ChaoticByte 2024-10-16 20:23:53 +02:00
parent e8985f4e79
commit a3ca623258
No known key found for this signature in database
32 changed files with 391 additions and 247 deletions

View file

@ -1,9 +0,0 @@
extends Node2D
func _on_area_2d_body_entered(body: Node2D) -> void:
if body == NodeRegistry.player:
NodeRegistry.player.die()
func _on_next_level_body_entered(body: Node2D) -> void:
if body == NodeRegistry.player:
Levels.load_entrypoint("test")

View file

@ -1,86 +0,0 @@
[gd_scene load_steps=9 format=3 uid="uid://c6w7lrydi43ts"]
[ext_resource type="PackedScene" uid="uid://cbynoofsjcl45" path="res://core/polygon/polygon.tscn" id="1_cup10"]
[ext_resource type="Script" path="res://levels/intro.gd" id="1_pgj82"]
[ext_resource type="Script" path="res://core/audio/spatial_audio_player.gd" id="3_3eqhh"]
[ext_resource type="AudioStream" uid="uid://cs6l2t3jtags8" path="res://assets/sounds/clock-tick-76039.mp3" id="3_6yss2"]
[sub_resource type="Animation" id="Animation_h8pmj"]
resource_name = "audio"
length = 10.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationPlayer/Polygon2D:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1.96667, 4.46667, 6.46667, 6.76667, 7.23333, 8.13333),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector2(768, 328), Vector2(888, 178), Vector2(256, 208), Vector2(384, 328), Vector2(512, 336), Vector2(520, 408), Vector2(472, 408)]
}
[sub_resource type="Animation" id="Animation_i0i2l"]
length = 0.001
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ucyvg"]
_data = {
"RESET": SubResource("Animation_i0i2l"),
"audio": SubResource("Animation_h8pmj")
}
[sub_resource type="GDScript" id="GDScript_e2u3o"]
script/source = "extends AnimationPlayer
func _ready() -> void:
self.play(\"audio\")
"
[node name="Intro" type="Node2D"]
script = ExtResource("1_pgj82")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="Polygon" parent="StaticBody2D" instance=ExtResource("1_cup10")]
polygon = PackedVector2Array(64, 200, 64, 432, -176, 432, -176, 512, 960, 512, 960, 384, 648, 384, 648, 344, 704, 344, 704, 288, 616, 288, 616, 232, 408, 232, 408, 304, 544, 304, 544, 384, 544, 432, 408, 432, 408, 392, 488, 392, 488, 352, 360, 352, 360, 440, 256, 440, 256, 320, 192, 320, 192, 440, 128, 440, 128, 200)
[node name="Polygon2" parent="StaticBody2D" instance=ExtResource("1_cup10")]
polygon = PackedVector2Array(448, 64, 448, 88, 512, 88, 512, 128, 384, 128, 384, 152, 640, 152, 640, 128, 688, 128, 688, 64)
[node name="Area2D" type="Area2D" parent="."]
[node name="Polygon" parent="Area2D" instance=ExtResource("1_cup10")]
polygon = PackedVector2Array(128, 384, 192, 384, 192, 440, 128, 440)
color = Color(1, 0.1, 0, 1)
[node name="Polygon2" parent="Area2D" instance=ExtResource("1_cup10")]
polygon = PackedVector2Array(256, 384, 360, 384, 360, 440, 256, 440)
color = Color(1, 0.1, 0, 1)
[node name="next_level" type="Area2D" parent="."]
[node name="Polygon" parent="next_level" instance=ExtResource("1_cup10")]
polygon = PackedVector2Array(416, 400, 416, 424, 440, 424, 440, 400)
color = Color(0.484431, 0.687354, 1, 1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ucyvg")
}
script = SubResource("GDScript_e2u3o")
[node name="Polygon2D" type="Polygon2D" parent="AnimationPlayer"]
position = Vector2(768, 328)
polygon = PackedVector2Array(0, -8, -8, 0, 0, 8, 8, 0)
[node name="SpatialAudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="AnimationPlayer/Polygon2D"]
stream = ExtResource("3_6yss2")
volume_db = 5.0
autoplay = true
script = ExtResource("3_3eqhh")
detect_mod = 2
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
[connection signal="body_entered" from="next_level" to="." method="_on_next_level_body_entered"]

13
levels/intro/intro.gd Normal file
View file

@ -0,0 +1,13 @@
extends Node2D
func _on_next_level_body_entered(body: Node2D) -> void:
if body == NodeRegistry.player:
LevelsCore.load_entrypoint("test")
func _on_unlock_player_body_entered(body: Node2D) -> void:
if body == NodeRegistry.player:
body.locked = false
func _on_delete_bodies_body_entered(body: Node2D) -> void:
if body != NodeRegistry.player:
body.call_deferred("queue_free")

83
levels/intro/intro.tscn Normal file
View file

@ -0,0 +1,83 @@
[gd_scene load_steps=8 format=3 uid="uid://c6w7lrydi43ts"]
[ext_resource type="Script" path="res://levels/intro/intro.gd" id="1_pgj82"]
[ext_resource type="Script" path="res://reusable/conveyor/conveyor.gd" id="3_0til7"]
[ext_resource type="Script" path="res://core/polygon/polygon.gd" id="3_3lt07"]
[ext_resource type="Script" path="res://reusable/spawner.gd" id="4_xsg5s"]
[ext_resource type="PackedScene" uid="uid://cylmgbhvpdexh" path="res://reusable/aged_box/aged_box.tscn" id="5_hjicl"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fkj57"]
size = Vector2(2288, 96)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0hgjk"]
size = Vector2(14224, 656)
[node name="Intro" type="Node2D"]
script = ExtResource("1_pgj82")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="P" type="CollisionPolygon2D" parent="StaticBody2D"]
polygon = PackedVector2Array(-1216, 64, 32, 64, 32, 88, 0, 88, 0, 416, -448, 416, -448, 488, -32, 488, -32, 512, -64, 512, -64, 1664, 2240, 1664, 2240, 2624, -1856, 2624, -1856, 64)
script = ExtResource("3_3lt07")
[node name="Conveyor" type="Node2D" parent="."]
position = Vector2(-1472, 66)
script = ExtResource("3_0til7")
conveyor_segments = 188
speed_mult = 50.0
[node name="Spawner" type="Node2D" parent="."]
position = Vector2(-1440, 32)
script = ExtResource("4_xsg5s")
spawn_interval_secs = 7.0
spawn_interval_rand = 0.5
scene = ExtResource("5_hjicl")
[node name="Conveyor2" type="Node2D" parent="."]
position = Vector2(-448, 490)
script = ExtResource("3_0til7")
conveyor_segments = 52
speed_mult = 50.0
[node name="Spawner2" type="Node2D" parent="."]
position = Vector2(-413, 448)
script = ExtResource("4_xsg5s")
spawn_interval_secs = 10.0
spawn_interval_rand = 0.5
scene = ExtResource("5_hjicl")
[node name="Marker2D" type="Marker2D" parent="."]
position = Vector2(-1440, 56)
[node name="P" type="CollisionPolygon2D" parent="."]
polygon = PackedVector2Array(-1216, -576, -1216, 320, -1856, 320, -1856, -576)
script = ExtResource("3_3lt07")
[node name="Spawner_pile" type="Node2D" parent="."]
position = Vector2(160, 928)
script = ExtResource("4_xsg5s")
spawn_interval_secs = 0.02
stop_after_secs = 5.0
amount_per_interval = 4
jitter_spawnpoint = true
scene = ExtResource("5_hjicl")
[node name="UnlockPlayer" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="UnlockPlayer"]
position = Vector2(1080, 688)
shape = SubResource("RectangleShape2D_fkj57")
[node name="DeleteBodies" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="DeleteBodies"]
position = Vector2(3232, 3032)
shape = SubResource("RectangleShape2D_0hgjk")
[node name="P2" type="CollisionPolygon2D" parent="."]
polygon = PackedVector2Array(-352, 384, -352, 512, -512, 512, -512, 384)
script = ExtResource("3_3lt07")
[connection signal="body_entered" from="UnlockPlayer" to="." method="_on_unlock_player_body_entered"]
[connection signal="body_entered" from="DeleteBodies" to="." method="_on_delete_bodies_body_entered"]

19
levels/levels_def.gd Normal file
View file

@ -0,0 +1,19 @@
extends Node
const SCENES = {
"menu": "uid://bqmpoix37kutp",
"intro": "uid://c6w7lrydi43ts",
"test": "uid://dqf665b540tfg",
}
var ENTRYPOINTS = {
"intro_start": LevelsCore.Entrypoint.new(
"intro",
Vector2(-1440, 56),
false, Vector2.ZERO,
true),
"test": LevelsCore.Entrypoint.new(
"test",
Vector2(1680, 200),
false, Vector2(0, -500)),
}

View file

@ -1,18 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://dqf665b540tfg"]
[ext_resource type="PackedScene" uid="uid://cbynoofsjcl45" path="res://core/polygon/polygon.tscn" id="1_xm2ft"]
[ext_resource type="PackedScene" uid="uid://b8cjp6hiqycxe" path="res://core/rain.tscn" id="2_31352"]
[ext_resource type="Script" path="res://core/polygon/polygon.gd" id="2_m4j53"]
[node name="Test" type="Node2D"]
position = Vector2(1680, 80)
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="Polygon" parent="StaticBody2D" instance=ExtResource("1_xm2ft")]
[node name="P" type="CollisionPolygon2D" parent="StaticBody2D"]
polygon = PackedVector2Array(-104, 232, -104, 320, 1024, 320, 1024, 232)
script = ExtResource("2_m4j53")
[node name="Polygon2" parent="StaticBody2D" instance=ExtResource("1_xm2ft")]
[node name="P2" type="CollisionPolygon2D" parent="StaticBody2D"]
polygon = PackedVector2Array(-208, 184, -144, 184, -144, -400, 1008, -400, 1008, 176, 1072, 176, 1072, -464, -208, -464)
script = ExtResource("2_m4j53")
[node name="Rain" parent="." instance=ExtResource("2_31352")]
position = Vector2(433.72, -396.25)