This commit is contained in:
dan
2025-03-22 20:21:52 -04:00
commit ea36511c71
63 changed files with 1992 additions and 0 deletions

223
scenes/coin.tscn Normal file
View File

@@ -0,0 +1,223 @@
[gd_scene load_steps=21 format=3 uid="uid://rbfbwxr7wsro"]
[ext_resource type="Script" uid="uid://dafe64tmpvrbe" path="res://scripts/coin.gd" id="1_i64fm"]
[ext_resource type="Texture2D" uid="uid://bumwkwuxq07qe" path="res://assets/brackeys_platformer_assets/sprites/coin.png" id="1_rwqht"]
[ext_resource type="AudioStream" uid="uid://p8u882irnnt1" path="res://assets/brackeys_platformer_assets/sounds/coin.wav" id="3_11l1o"]
[sub_resource type="AtlasTexture" id="AtlasTexture_i64fm"]
atlas = ExtResource("1_rwqht")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_11l1o"]
atlas = ExtResource("1_rwqht")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_d14el"]
atlas = ExtResource("1_rwqht")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_1ikuy"]
atlas = ExtResource("1_rwqht")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wnlwo"]
atlas = ExtResource("1_rwqht")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jig8b"]
atlas = ExtResource("1_rwqht")
region = Rect2(80, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_xmuha"]
atlas = ExtResource("1_rwqht")
region = Rect2(96, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_kfxoj"]
atlas = ExtResource("1_rwqht")
region = Rect2(112, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jsmju"]
atlas = ExtResource("1_rwqht")
region = Rect2(128, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_s0mny"]
atlas = ExtResource("1_rwqht")
region = Rect2(144, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_7cc30"]
atlas = ExtResource("1_rwqht")
region = Rect2(160, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_rojmm"]
atlas = ExtResource("1_rwqht")
region = Rect2(176, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_kahox"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_i64fm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_11l1o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d14el")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1ikuy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wnlwo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jig8b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xmuha")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kfxoj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jsmju")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s0mny")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7cc30")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rojmm")
}],
"loop": true,
"name": &"default",
"speed": 11.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_kahox"]
radius = 5.09902
[sub_resource type="Animation" id="Animation_11l1o"]
resource_name = "pickup_sound"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("PickupSound:playing")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/3/type = "method"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath(".")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.866667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"queue_free"
}]
}
[sub_resource type="Animation" id="Animation_d14el"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("PickupSound:playing")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_1ikuy"]
_data = {
&"RESET": SubResource("Animation_d14el"),
&"pickup_sound": SubResource("Animation_11l1o")
}
[node name="Coin" type="Node2D"]
[node name="Area2D" type="Area2D" parent="."]
collision_mask = 2
script = ExtResource("1_i64fm")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Area2D"]
sprite_frames = SubResource("SpriteFrames_kahox")
autoplay = "default"
frame_progress = 0.772651
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_kahox")
[node name="PickupSound" type="AudioStreamPlayer2D" parent="Area2D"]
stream = ExtResource("3_11l1o")
bus = &"Sfx"
[node name="AnimationPlayer" type="AnimationPlayer" parent="Area2D"]
libraries = {
&"": SubResource("AnimationLibrary_1ikuy")
}
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]

8
scenes/game.gd Normal file
View File

@@ -0,0 +1,8 @@
extends Node2D
func _ready() -> void:
print("game _ready")
GameManager.set_label($labels/ScoreLabel)
func _init() -> void:
pass

1
scenes/game.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://gyfm5wk3yp3c

368
scenes/game.tscn Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14
scenes/killzone.tscn Normal file
View File

@@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=3 uid="uid://ddnw180bowxn2"]
[ext_resource type="Script" uid="uid://db8xxth4oa6xg" path="res://scripts/killzone.gd" id="1_xlapc"]
[node name="killzone" type="Area2D"]
collision_mask = 2
script = ExtResource("1_xlapc")
[node name="Timer" type="Timer" parent="."]
wait_time = 0.6
one_shot = true
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

8
scenes/music.tscn Normal file
View File

@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://d1mcuinlcj13w"]
[ext_resource type="AudioStream" uid="uid://cqgvfu5x0f21s" path="res://assets/brackeys_platformer_assets/music/time_for_adventure.mp3" id="1_05ggv"]
[node name="Music" type="AudioStreamPlayer2D"]
stream = ExtResource("1_05ggv")
autoplay = true
bus = &"Music"

17
scenes/platform.tscn Normal file
View File

@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3 uid="uid://ct26ixf6dfdec"]
[ext_resource type="Texture2D" uid="uid://c2cq8egoxepdj" path="res://assets/brackeys_platformer_assets/sprites/platforms.png" id="1_ba0x2"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nlgqw"]
size = Vector2(32, 8)
[node name="Platform" type="AnimatableBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_ba0x2")
region_enabled = true
region_rect = Rect2(16, 0, 32, 9)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_nlgqw")
one_way_collision = true

186
scenes/player.tscn Normal file
View File

@@ -0,0 +1,186 @@
[gd_scene load_steps=26 format=3 uid="uid://b72smvvbacy6g"]
[ext_resource type="Texture2D" uid="uid://bda78yggl3vfm" path="res://assets/brackeys_platformer_assets/sprites/knight.png" id="1_3vyb7"]
[ext_resource type="Script" uid="uid://dfmh1h3u1186s" path="res://scripts/playermovement.gd" id="1_g2els"]
[sub_resource type="AtlasTexture" id="AtlasTexture_g2els"]
atlas = ExtResource("1_3vyb7")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qhqgy"]
atlas = ExtResource("1_3vyb7")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_dqkch"]
atlas = ExtResource("1_3vyb7")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qlg0r"]
atlas = ExtResource("1_3vyb7")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_tuyoq"]
atlas = ExtResource("1_3vyb7")
region = Rect2(64, 160, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fjrip"]
atlas = ExtResource("1_3vyb7")
region = Rect2(0, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_smehm"]
atlas = ExtResource("1_3vyb7")
region = Rect2(32, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ur7pv"]
atlas = ExtResource("1_3vyb7")
region = Rect2(64, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_y4r1p"]
atlas = ExtResource("1_3vyb7")
region = Rect2(96, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_d2wvv"]
atlas = ExtResource("1_3vyb7")
region = Rect2(128, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_3v2ag"]
atlas = ExtResource("1_3vyb7")
region = Rect2(160, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jej6c"]
atlas = ExtResource("1_3vyb7")
region = Rect2(192, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_f1ej7"]
atlas = ExtResource("1_3vyb7")
region = Rect2(224, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_oprun"]
atlas = ExtResource("1_3vyb7")
region = Rect2(0, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_a8ls1"]
atlas = ExtResource("1_3vyb7")
region = Rect2(32, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_qfm1y"]
atlas = ExtResource("1_3vyb7")
region = Rect2(64, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fulsm"]
atlas = ExtResource("1_3vyb7")
region = Rect2(96, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_4r5pv"]
atlas = ExtResource("1_3vyb7")
region = Rect2(128, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_60mlk"]
atlas = ExtResource("1_3vyb7")
region = Rect2(160, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_i4ail"]
atlas = ExtResource("1_3vyb7")
region = Rect2(192, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_a38lo"]
atlas = ExtResource("1_3vyb7")
region = Rect2(224, 96, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_tuyoq"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_g2els")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qhqgy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dqkch")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qlg0r")
}],
"loop": true,
"name": &"default",
"speed": 6.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tuyoq")
}],
"loop": true,
"name": &"jump",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_fjrip")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_smehm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ur7pv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_y4r1p")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d2wvv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3v2ag")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jej6c")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f1ej7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oprun")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a8ls1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qfm1y")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fulsm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4r5pv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_60mlk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_i4ail")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a38lo")
}],
"loop": true,
"name": &"run",
"speed": 11.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_3vyb7"]
radius = 6.0
[node name="Player" type="CharacterBody2D"]
z_index = 3
collision_layer = 2
script = ExtResource("1_g2els")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_tuyoq")
animation = &"jump"
autoplay = "default"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 6)
shape = SubResource("CircleShape2D_3vyb7")

68
scenes/slime.tscn Normal file
View File

@@ -0,0 +1,68 @@
[gd_scene load_steps=10 format=3 uid="uid://cj35suv0ggfps"]
[ext_resource type="Script" uid="uid://b3qxwn2ta73vx" path="res://scripts/slime.gd" id="1_n6pvg"]
[ext_resource type="Texture2D" uid="uid://bbfytacurofqi" path="res://assets/brackeys_platformer_assets/sprites/slime_green.png" id="1_p2gj0"]
[ext_resource type="PackedScene" uid="uid://ddnw180bowxn2" path="res://scenes/killzone.tscn" id="2_n6pvg"]
[sub_resource type="AtlasTexture" id="AtlasTexture_pjw23"]
atlas = ExtResource("1_p2gj0")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_2npkn"]
atlas = ExtResource("1_p2gj0")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_fd6lc"]
atlas = ExtResource("1_p2gj0")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_gstla"]
atlas = ExtResource("1_p2gj0")
region = Rect2(72, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_v5wyi"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_pjw23")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2npkn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fd6lc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gstla")
}],
"loop": true,
"name": &"idle",
"speed": 10.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0l8pv"]
size = Vector2(10, 15)
[node name="Slime" type="Node2D"]
script = ExtResource("1_n6pvg")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -12)
sprite_frames = SubResource("SpriteFrames_v5wyi")
animation = &"idle"
autoplay = "idle"
frame_progress = 0.153602
[node name="killzone" parent="." instance=ExtResource("2_n6pvg")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="killzone"]
position = Vector2(0, -7.5)
shape = SubResource("RectangleShape2D_0l8pv")
[node name="raycastright" type="RayCast2D" parent="."]
position = Vector2(0, -7)
target_position = Vector2(10, 0)
[node name="raycastleft" type="RayCast2D" parent="."]
position = Vector2(1, -7)
target_position = Vector2(-9, 0)