week 5 enemies pickups player death

This commit is contained in:
Jeremy committed 2024-08-12 21:10:25 -04:00
1 parent 17520bb17d
commit d4b5181c01
76 files changed
+1308 -163

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
[gd_scene load_steps=9 format=3 uid="uid://dvied5dxkc7e0"]
[ext_resource type="Script" path="res://scripts/badguy.gd" id="1_7u81x"]
[ext_resource type="Texture2D" uid="uid://bw43f1enjixbk" path="res://graphics/enemies/slime_purple.png" id="1_anh2u"]
[sub_resource type="AtlasTexture" id="AtlasTexture_o20x5"]
atlas = ExtResource("1_anh2u")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_o8v3c"]
atlas = ExtResource("1_anh2u")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_tsden"]
atlas = ExtResource("1_anh2u")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_o7cwn"]
atlas = ExtResource("1_anh2u")
region = Rect2(72, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_uh2us"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_o20x5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o8v3c")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tsden")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o7cwn")
}],
"loop": true,
"name": &"chase",
"speed": 12.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vdsen"]
size = Vector2(14, 15)
[node name="Area2D" type="Area2D"]
script = ExtResource("1_7u81x")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_uh2us")
animation = &"chase"
autoplay = "chase"
frame_progress = 0.56706
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 4.5)
shape = SubResource("RectangleShape2D_vdsen")
[node name="RightCast" type="RayCast2D" parent="."]
target_position = Vector2(13, 0)
[node name="LeftCast" type="RayCast2D" parent="."]
target_position = Vector2(-13, 0)
[node name="rightFloorCast" type="RayCast2D" parent="."]
position = Vector2(7, 0)
target_position = Vector2(0, 15)
[node name="leftFloorCast" type="RayCast2D" parent="."]
position = Vector2(-7, 0)
target_position = Vector2(0, 15)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+80 -2
View File
@@ -1,10 +1,51 @@
[gd_scene load_steps=28 format=3 uid="uid://go4yc8hfo1gq"]
[gd_scene load_steps=39 format=3 uid="uid://go4yc8hfo1gq"]
[ext_resource type="Script" path="res://scripts/CharacterBody2D.gd" id="1_x87yo"]
[ext_resource type="Texture2D" uid="uid://c8ogee5u6uxld" path="res://graphics/Player Death/Player Death 64x64.png" id="2_byx7v"]
[ext_resource type="Texture2D" uid="uid://c0iiaebonyhh0" path="res://graphics/Player Idle/Player Idle 48x48.png" id="2_hyqch"]
[ext_resource type="Texture2D" uid="uid://xgoqfqmvorcx" path="res://graphics/Player Jump/player jump 48x48.png" id="3_mp84c"]
[ext_resource type="Texture2D" uid="uid://vn23qn3f0dvc" path="res://graphics/Player Run/player run 48x48.png" id="4_bok64"]
[sub_resource type="AtlasTexture" id="AtlasTexture_i0o8b"]
atlas = ExtResource("2_byx7v")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ppvnc"]
atlas = ExtResource("2_byx7v")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_yo8u7"]
atlas = ExtResource("2_byx7v")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_eioko"]
atlas = ExtResource("2_byx7v")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_dmhe1"]
atlas = ExtResource("2_byx7v")
region = Rect2(192, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_joqoj"]
atlas = ExtResource("2_byx7v")
region = Rect2(240, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_bykew"]
atlas = ExtResource("2_byx7v")
region = Rect2(288, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_b7x2x"]
atlas = ExtResource("2_byx7v")
region = Rect2(336, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_7lf4o"]
atlas = ExtResource("2_byx7v")
region = Rect2(384, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_gcy07"]
atlas = ExtResource("2_byx7v")
region = Rect2(432, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_htcu2"]
atlas = ExtResource("2_hyqch")
region = Rect2(0, 0, 48, 48)
@@ -93,6 +134,41 @@ region = Rect2(336, 0, 48, 48)
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_i0o8b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ppvnc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yo8u7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_eioko")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dmhe1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_joqoj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bykew")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b7x2x")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7lf4o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gcy07")
}],
"loop": false,
"name": &"death",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_htcu2")
}, {
"duration": 1.0,
@@ -182,8 +258,10 @@ metadata/_edit_group_ = true
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_a6t6h")
animation = &"idle"
animation = &"death"
autoplay = "idle"
frame = 9
frame_progress = 1.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 3)
+112
View File
@@ -0,0 +1,112 @@
[gd_scene load_steps=17 format=3 uid="uid://7e5lm5ck08k8"]
[ext_resource type="Texture2D" uid="uid://bu0wyq230xip1" path="res://graphics/pickups/coin.png" id="1_a1ga2"]
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_xu2uf"]
[sub_resource type="AtlasTexture" id="AtlasTexture_cphs5"]
atlas = ExtResource("1_a1ga2")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_24jk6"]
atlas = ExtResource("1_a1ga2")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_rgjgj"]
atlas = ExtResource("1_a1ga2")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_8ci21"]
atlas = ExtResource("1_a1ga2")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_i0cu2"]
atlas = ExtResource("1_a1ga2")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wtwtd"]
atlas = ExtResource("1_a1ga2")
region = Rect2(80, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_yxweu"]
atlas = ExtResource("1_a1ga2")
region = Rect2(96, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_b7n6q"]
atlas = ExtResource("1_a1ga2")
region = Rect2(112, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_mpw0r"]
atlas = ExtResource("1_a1ga2")
region = Rect2(128, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_o1nu1"]
atlas = ExtResource("1_a1ga2")
region = Rect2(144, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_frg1o"]
atlas = ExtResource("1_a1ga2")
region = Rect2(160, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_efpui"]
atlas = ExtResource("1_a1ga2")
region = Rect2(176, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_w1v5w"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cphs5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_24jk6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rgjgj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8ci21")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_i0cu2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wtwtd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yxweu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b7n6q")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mpw0r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o1nu1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_frg1o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_efpui")
}],
"loop": true,
"name": &"default",
"speed": 12.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_ngajn"]
radius = 6.0
[node name="Area2D" type="Area2D"]
script = ExtResource("1_xu2uf")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_w1v5w")
autoplay = "default"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_ngajn")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+113 -20
View File
@@ -1,11 +1,16 @@
[gd_scene load_steps=14 format=3 uid="uid://y083suj12rld"]
[gd_scene load_steps=19 format=3 uid="uid://y083suj12rld"]
[ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_77wyw"]
[ext_resource type="PackedScene" uid="uid://go4yc8hfo1gq" path="res://scenes/character.tscn" id="2_64ccm"]
[ext_resource type="Texture2D" uid="uid://dwb83f7uoweuy" path="res://graphics/Terrain (32x32).png" id="2_l22q1"]
[ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"]
[ext_resource type="Texture2D" uid="uid://bxcf8ryispa5c" path="res://graphics/background/BG Image.png" id="3_v42n4"]
[ext_resource type="Texture2D" uid="uid://ddrpxehpjros0" path="res://graphics/background/Additional Sky.png" id="4_ch8sb"]
[ext_resource type="Texture2D" uid="uid://clb5ryiub2nfh" path="res://graphics/background/Additional Water.png" id="5_01lp1"]
[ext_resource type="PackedScene" uid="uid://ukuu7p7vhlq" path="res://scenes/crate.tscn" id="5_u8rgi"]
[ext_resource type="PackedScene" uid="uid://i3l8y3rbx4o1" path="res://scenes/platform.tscn" id="6_t5a05"]
[ext_resource type="PackedScene" uid="uid://7e5lm5ck08k8" path="res://scenes/coin.tscn" id="10_yjg5o"]
[ext_resource type="PackedScene" uid="uid://dvied5dxkc7e0" path="res://scenes/badguy.tscn" id="11_ovphn"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_xg6qs"]
texture = ExtResource("2_l22q1")
@@ -482,6 +487,21 @@ sources/0 = SubResource("TileSetAtlasSource_xg6qs")
[sub_resource type="CircleShape2D" id="CircleShape2D_x8qck"]
radius = 60.2993
[sub_resource type="Animation" id="Animation_4jf1k"]
loop_mode = 2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(186, -65), Vector2(56, -65)]
}
[sub_resource type="Animation" id="Animation_scpii"]
resource_name = "move"
loop_mode = 2
@@ -498,21 +518,6 @@ tracks/0/keys = {
"values": [Vector2(66, -71), Vector2(131, -71)]
}
[sub_resource type="Animation" id="Animation_4jf1k"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5sp7p"]
_data = {
"RESET": SubResource("Animation_4jf1k"),
@@ -520,12 +525,37 @@ _data = {
}
[node name="Game" type="Node2D"]
[node name="GameController" type="Node" parent="."]
unique_name_in_owner = true
script = ExtResource("1_77wyw")
[node name="Timer" type="Timer" parent="GameController"]
[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource("TileSet_47g5u")
format = 2
layer_0/tile_data = PackedInt32Array(262141, 786432, 4, 262142, 65536, 4, 262143, 65536, 4, 196608, 65536, 4, 196609, 65536, 4, 196610, 131072, 4, 262149, 0, 1, 327685, 0, 2, 327686, 589824, 4, 327687, 65536, 2, 327688, 655360, 4, 327689, 65536, 2, 262153, 65536, 1, 196617, 655360, 3, 196616, 655360, 3, 196615, 65536, 0, 196614, 589824, 3, 196613, 0, 0, 262150, 65536, 1, 262151, 65536, 1, 262152, 65536, 1, 196618, 65536, 0, 262154, 65536, 1, 327690, 655360, 4, 327691, 65536, 2, 262155, 65536, 1, 196619, 655360, 3, 196620, 65536, 0, 262156, 65536, 1, 327692, 65536, 2, 65539, 0, 4, 65540, 131072, 4, -65540, 0, 0, -4, 393216, 4, 65532, 393216, 3, 131068, 0, 1, 131069, 458752, 3, 65533, 458752, 4, -3, 131072, 1, -65539, 131072, 0, 196605, 458752, 3, 196604, 393216, 3, 262140, 0, 2, 65535, 262144, 4, -65535, 262144, 4, 8, 0, 2, 9, 589824, 4, 10, 131072, 2, -65526, 131072, 0, -65527, 655360, 3, -65528, 0, 0, 6, 262144, 0, 65542, 262144, 2, 196621, 589824, 3, 196622, 131072, 0, 262158, 131072, 1, 327694, 131072, 2, 327693, 65536, 2, 262157, 65536, 1, -262132, 983040, 3, -262131, 65536, 4, -262130, 1048576, 3, -196594, 262144, 1, -131058, 1048576, 4, -131059, 65536, 4, -131060, 983040, 4, -196596, 262144, 1)
layer_0/tile_data = PackedInt32Array(262141, 786432, 4, 262142, 65536, 4, 262143, 65536, 4, 196608, 65536, 4, 196609, 65536, 4, 196610, 131072, 4, 262149, 0, 1, 327685, 0, 2, 327686, 589824, 4, 327687, 65536, 2, 327688, 655360, 4, 327689, 65536, 2, 262153, 65536, 1, 196617, 655360, 3, 196616, 655360, 3, 196615, 65536, 0, 196614, 589824, 3, 196613, 0, 0, 262150, 65536, 1, 262151, 65536, 1, 262152, 65536, 1, 196618, 65536, 0, 262154, 65536, 1, 327690, 655360, 4, 327691, 65536, 2, 262155, 65536, 1, 196619, 655360, 3, 196620, 65536, 0, 262156, 65536, 1, 327692, 65536, 2, 65539, 0, 4, 65540, 131072, 4, -65540, 0, 0, -4, 393216, 4, 65532, 393216, 3, 131068, 0, 1, 131069, 458752, 3, 65533, 458752, 4, -3, 131072, 1, -65539, 131072, 0, 196605, 458752, 3, 196604, 393216, 3, 262140, 0, 2, 65535, 262144, 4, -65535, 262144, 4, 8, 0, 2, 9, 589824, 4, 10, 131072, 2, -65526, 131072, 0, -65527, 655360, 3, -65528, 0, 0, 6, 262144, 0, 65542, 262144, 2, 196621, 851968, 0, 196622, 131072, 0, 262158, 131072, 1, 327694, 131072, 2, 327693, 65536, 2, 262157, 65536, 1, -262130, 1048576, 3, -196594, 262144, 1, -131058, 1048576, 4, -131059, 65536, 4, -131060, 983040, 4, -196596, 262144, 1, -262132, 983040, 3, -262131, 65536, 4, 65550, 983040, 3, 65551, 131072, 4, -65520, 0, 4, -65519, 65536, 4, -65518, 131072, 4, -196592, 262144, 4, 131086, 851968, 4, 131085, 0, 0)
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
motion_mirroring = Vector2(324, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
position = Vector2(91, 50)
scale = Vector2(1.16146, 1)
texture = ExtResource("3_v42n4")
[node name="Sprite2D2" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
position = Vector2(91, -176)
scale = Vector2(13.9375, 11.5)
texture = ExtResource("4_ch8sb")
[node name="Sprite2D3" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
position = Vector2(91, 175)
scale = Vector2(13.9375, 4)
texture = ExtResource("5_01lp1")
[node name="level" type="Node2D" parent="."]
@@ -543,7 +573,8 @@ PUSH_FORCE = 550
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
[node name="AreaTrigger" type="Area2D" parent="."]
position = Vector2(306, -24)
position = Vector2(304, -37)
scale = Vector2(0.8, 0.96)
script = ExtResource("2_nfj1w")
metadata/_edit_group_ = true
@@ -554,7 +585,7 @@ debug_color = Color(0.556863, 0.415686, 0.964706, 0.419608)
[node name="crates" type="Node" parent="."]
[node name="crate1" parent="crates" instance=ExtResource("5_u8rgi")]
position = Vector2(114, 30)
position = Vector2(112, 24)
[node name="crate2" parent="crates" instance=ExtResource("5_u8rgi")]
position = Vector2(435, -154)
@@ -563,6 +594,8 @@ position = Vector2(435, -154)
position = Vector2(44, -71)
[node name="Platform" parent="." instance=ExtResource("6_t5a05")]
position = Vector2(186, -65)
metadata/_edit_group_ = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="Platform"]
libraries = {
@@ -573,5 +606,65 @@ autoplay = "move"
[node name="BoxTrap" type="Node2D" parent="."]
position = Vector2(304, -140)
[connection signal="areatrigger" from="AreaTrigger" to="." method="_on_area_2d_areatrigger"]
[node name="coins" type="Node" parent="."]
[node name="coin" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(208, -11)
[node name="coin2" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(407, -138)
[node name="coin3" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(459, -139)
[node name="coin4" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(-16, -9)
[node name="coin5" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(-95, -74)
[node name="coin6" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(48, -44)
[node name="coin7" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(264, 83)
[node name="coin8" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(312, 83)
[node name="coin9" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(357, 82)
[node name="coin10" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(306, -42)
[node name="coin11" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(397, 83)
[node name="coin12" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(467, 20)
[node name="coin13" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(494, 20)
[node name="coin14" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(527, -110)
[node name="coin15" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(536, -44)
[node name="coin16" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(560, -44)
[node name="coin17" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(584, -44)
[node name="coin18" parent="coins" instance=ExtResource("10_yjg5o")]
position = Vector2(218, 83)
[node name="badguy" parent="." instance=ExtResource("11_ovphn")]
position = Vector2(179, 84)
[connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"]
[connection signal="areatrigger" from="AreaTrigger" to="GameController" method="_on_area_2d_areatrigger"]
[connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"]