Added coins, enemies, player death

This commit is contained in:
winniewk committed 2024-08-12 21:10:32 -04:00
1 parent f2241640ae
commit 660d311752
60 files changed
+1551 -90

No files matched your search

+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://714a2jbwrdbp" path="res://graphics/playerDeath/Player Death 64x64.png" id="2_gg54n"]
[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_eawrl"]
atlas = ExtResource("2_gg54n")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_8uxgh"]
atlas = ExtResource("2_gg54n")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_2vbai"]
atlas = ExtResource("2_gg54n")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ekybb"]
atlas = ExtResource("2_gg54n")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_aq2t0"]
atlas = ExtResource("2_gg54n")
region = Rect2(192, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_7gx0v"]
atlas = ExtResource("2_gg54n")
region = Rect2(240, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_lqk3s"]
atlas = ExtResource("2_gg54n")
region = Rect2(288, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_4pmeq"]
atlas = ExtResource("2_gg54n")
region = Rect2(336, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_l14r3"]
atlas = ExtResource("2_gg54n")
region = Rect2(384, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_hw4pw"]
atlas = ExtResource("2_gg54n")
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_eawrl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8uxgh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2vbai")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ekybb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_aq2t0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7gx0v")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lqk3s")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4pmeq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l14r3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hw4pw")
}],
"loop": false,
"name": &"death",
"speed": 15.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)
+114
View File
@@ -0,0 +1,114 @@
[gd_scene load_steps=17 format=3 uid="uid://5vkisovypn7u"]
[ext_resource type="Texture2D" uid="uid://b38vv525jl8cd" path="res://graphics/pickups/coin.png" id="1_2y2ug"]
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_r77r7"]
[sub_resource type="AtlasTexture" id="AtlasTexture_s13tt"]
atlas = ExtResource("1_2y2ug")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_unjf0"]
atlas = ExtResource("1_2y2ug")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_o3g5t"]
atlas = ExtResource("1_2y2ug")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jdjim"]
atlas = ExtResource("1_2y2ug")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_2ioij"]
atlas = ExtResource("1_2y2ug")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_tq0rv"]
atlas = ExtResource("1_2y2ug")
region = Rect2(80, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ibt7n"]
atlas = ExtResource("1_2y2ug")
region = Rect2(96, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_8f32r"]
atlas = ExtResource("1_2y2ug")
region = Rect2(112, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_2e8ei"]
atlas = ExtResource("1_2y2ug")
region = Rect2(128, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8fb8"]
atlas = ExtResource("1_2y2ug")
region = Rect2(144, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_q5swd"]
atlas = ExtResource("1_2y2ug")
region = Rect2(160, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_x8igk"]
atlas = ExtResource("1_2y2ug")
region = Rect2(176, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_xm54r"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_s13tt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_unjf0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o3g5t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jdjim")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2ioij")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tq0rv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ibt7n")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8f32r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2e8ei")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l8fb8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_q5swd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x8igk")
}],
"loop": true,
"name": &"default",
"speed": 12.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_r45ua"]
radius = 5.09902
[node name="Coin" type="Area2D"]
script = ExtResource("1_r77r7")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_xm54r")
autoplay = "default"
frame = 4
frame_progress = 0.902593
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_r45ua")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+96 -19
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://doodiicuxeb53" path="res://graphics/background/BG Image.png" id="3_1agog"]
[ext_resource type="Texture2D" uid="uid://ry5bkalocmx5" path="res://graphics/background/Additional Sky.png" id="4_g10bt"]
[ext_resource type="Texture2D" uid="uid://cl2dnusewe0ch" path="res://graphics/background/Additional Water.png" id="5_ax33h"]
[ext_resource type="PackedScene" uid="uid://ukuu7p7vhlq" path="res://scenes/crate.tscn" id="5_u8rgi"]
[ext_resource type="PackedScene" uid="uid://c5w3e6gjovcvk" path="res://scenes/platform.tscn" id="6_0ewk8"]
[ext_resource type="PackedScene" uid="uid://5vkisovypn7u" path="res://scenes/coin.tscn" id="10_vh708"]
[ext_resource type="PackedScene" uid="uid://b07px1qf5obql" path="res://scenes/slimeEnemy.tscn" id="11_gnd6o"]
[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_spruu"]
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="Animation" id="Animation_qecmg"]
resource_name = "move"
loop_mode = 2
@@ -498,21 +518,6 @@ tracks/0/keys = {
"values": [Vector2(0, 0), Vector2(100, 0)]
}
[sub_resource type="Animation" id="Animation_spruu"]
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_3nvvt"]
_data = {
"RESET": SubResource("Animation_spruu"),
@@ -520,13 +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(327682, 0, 4, 327683, 65536, 4, 327684, 65536, 4, 327685, 65536, 4, 327686, 65536, 4, 327687, 65536, 4, 327688, 65536, 4, 327689, 65536, 4, 327690, 655360, 4, 262154, 0, 0, 262155, 589824, 3, 262156, 655360, 3, 327692, 65536, 2, 327691, 655360, 4, 327693, 655360, 4, 262157, 458752, 1, 196621, 393216, 4, 131085, 0, 0, 131086, 131072, 0, 196622, 131072, 1, 262158, 131072, 1, 327694, 131072, 2, 196624, 0, 4, 196625, 65536, 4, 196626, 65536, 4, 196627, 65536, 4, 196628, 131072, 4, 393215, 131072, 4, 393214, 65536, 4, 393213, 65536, 4, 393212, 0, 4, 131072, 0, 4, 131073, 65536, 4, 131074, 131072, 4, 65543, 0, 4, 65544, 65536, 4, 65545, 131072, 4, 65559, 0, 0, 131095, 0, 2, 131098, 131072, 2, 65562, 131072, 0, 65561, 65536, 0, 65560, 65536, 0, 131096, 65536, 2, 131097, 65536, 2, -131060, 0, 4, -131059, 65536, 4, -131058, 65536, 4, -131057, 131072, 4, -196589, 262144, 0, -131053, 262144, 1, -65517, 262144, 2, 65528, 786432, 3, 131064, 262144, 1, 196600, 983040, 4, 196601, 65536, 4, 196602, 65536, 4, 196603, 131072, 4, -8, 0, 0, -7, 851968, 3, -6, 65536, 4, -5, 131072, 4, 65529, 1048576, 4)
[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(150, 50)
texture = ExtResource("3_1agog")
[node name="Sprite2D2" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
position = Vector2(150, -161)
scale = Vector2(12.0312, 9.3125)
texture = ExtResource("4_g10bt")
[node name="Sprite2D3" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
position = Vector2(150.5, 212)
scale = Vector2(11.9688, 7.1875)
texture = ExtResource("5_ax33h")
[node name="level" type="Node2D" parent="."]
[node name="StaticBody2D" type="StaticBody2D" parent="level"]
@@ -537,13 +566,13 @@ metadata/_edit_group_ = true
shape = SubResource("WorldBoundaryShape2D_3u4a8")
[node name="CharacterBody2D" parent="." groups=["player"] instance=ExtResource("2_64ccm")]
position = Vector2(41, 43)
position = Vector2(340, 90)
PUSH_FORCE = 550
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
[node name="AreaTrigger" type="Area2D" parent="."]
position = Vector2(274, 22)
position = Vector2(274, -1)
script = ExtResource("2_nfj1w")
metadata/_edit_group_ = true
@@ -567,5 +596,53 @@ autoplay = "move"
[node name="BoxTrap" type="Node2D" parent="."]
position = Vector2(273, -87)
[connection signal="areatrigger" from="AreaTrigger" to="." method="_on_area_2d_areatrigger"]
[node name="Coins" type="Node" parent="."]
[node name="Area2D" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(164, 146)
[node name="Area2D2" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(200, 146)
[node name="Area2D3" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(234, 146)
[node name="Area2D4" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(-201, 54)
[node name="Area2D5" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(-166, 53)
[node name="Area2D6" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(-189, -42)
[node name="Area2D7" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(430, 52)
[node name="Area2D8" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(460, 52)
[node name="Area2D9" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(623, -108)
[node name="Area2D10" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(416, -75)
[node name="Area2D11" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(446, -76)
[node name="Area2D12" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(474, -76)
[node name="Area2D13" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(776, 21)
[node name="Area2D14" parent="Coins" instance=ExtResource("10_vh708")]
position = Vector2(814, 20)
[node name="SlimeEnemy" parent="." instance=ExtResource("11_gnd6o")]
position = Vector2(125, 149)
[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"]
+17
View File
@@ -0,0 +1,17 @@
[gd_scene load_steps=2 format=3 uid="uid://bgswt7yjl253s"]
[sub_resource type="SystemFont" id="SystemFont_g1xe5"]
[node name="Hud" type="CanvasLayer"]
[node name="Coins" type="Label" parent="."]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -17.0
offset_bottom = 42.0
grow_horizontal = 0
theme_override_fonts/font = SubResource("SystemFont_g1xe5")
theme_override_font_sizes/font_size = 30
text = "0"
horizontal_alignment = 2
+75
View File
@@ -0,0 +1,75 @@
[gd_scene load_steps=9 format=3 uid="uid://b07px1qf5obql"]
[ext_resource type="Texture2D" uid="uid://dl8k7bq5pkuvk" path="res://graphics/enemies/slime_purple.png" id="1_01o8e"]
[ext_resource type="Script" path="res://scripts/enemy.gd" id="1_c0t6u"]
[sub_resource type="AtlasTexture" id="AtlasTexture_afgjr"]
atlas = ExtResource("1_01o8e")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_jpmuv"]
atlas = ExtResource("1_01o8e")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_mdgjq"]
atlas = ExtResource("1_01o8e")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_ib0iy"]
atlas = ExtResource("1_01o8e")
region = Rect2(72, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_cmpmq"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_afgjr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jpmuv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mdgjq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ib0iy")
}],
"loop": true,
"name": &"chase",
"speed": 8.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5m2pq"]
size = Vector2(14, 15)
[node name="SlimeEnemy" type="Area2D"]
script = ExtResource("1_c0t6u")
metadata/_edit_group_ = true
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_cmpmq")
animation = &"chase"
autoplay = "chase"
frame = 1
frame_progress = 0.134127
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 4.5)
shape = SubResource("RectangleShape2D_5m2pq")
[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, 18)
[node name="LeftFloorCast" type="RayCast2D" parent="."]
position = Vector2(-7, 0)
target_position = Vector2(0, 18)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]