player death working

This commit is contained in:
OddlyTimbot committed 2024-08-12 17:43:39 -04:00
1 parent eebf4c2922
commit 03f366b0e1
43 files changed
+287 -138

No files matched your search

+10 -2
View File
@@ -40,7 +40,7 @@ animations = [{
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jipcy"]
size = Vector2(17, 14)
size = Vector2(17, 15)
[node name="Area2D" type="Area2D"]
script = ExtResource("1_ees8e")
@@ -56,7 +56,15 @@ target_position = Vector2(15, 0)
target_position = Vector2(-16, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-0.5, 5)
position = Vector2(-0.5, 4.5)
shape = SubResource("RectangleShape2D_jipcy")
[node name="CastFloorRight" type="RayCast2D" parent="."]
position = Vector2(10, 1)
target_position = Vector2(0, 14)
[node name="CastFloorLeft" type="RayCast2D" parent="."]
position = Vector2(-11, 0)
target_position = Vector2(0, 14)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+57 -2
View File
@@ -1,10 +1,39 @@
[gd_scene load_steps=28 format=3 uid="uid://go4yc8hfo1gq"]
[gd_scene load_steps=36 format=3 uid="uid://go4yc8hfo1gq"]
[ext_resource type="Script" path="res://scripts/CharacterBody2D.gd" id="1_x87yo"]
[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://bwnec1thq1btr" path="res://graphics/Player Death/Player Death 64x64.png" id="2_pndqh"]
[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_dlawb"]
atlas = ExtResource("2_pndqh")
region = Rect2(0, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_6goxi"]
atlas = ExtResource("2_pndqh")
region = Rect2(43, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_w5uym"]
atlas = ExtResource("2_pndqh")
region = Rect2(86, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_4d8rt"]
atlas = ExtResource("2_pndqh")
region = Rect2(129, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_5boyf"]
atlas = ExtResource("2_pndqh")
region = Rect2(344, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_bhip8"]
atlas = ExtResource("2_pndqh")
region = Rect2(387, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_si011"]
atlas = ExtResource("2_pndqh")
region = Rect2(430, 0, 43, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_htcu2"]
atlas = ExtResource("2_hyqch")
region = Rect2(0, 0, 48, 48)
@@ -93,6 +122,32 @@ region = Rect2(336, 0, 48, 48)
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_dlawb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6goxi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w5uym")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4d8rt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5boyf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bhip8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_si011")
}],
"loop": false,
"name": &"death",
"speed": 15.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_htcu2")
}, {
"duration": 1.0,
@@ -182,7 +237,7 @@ metadata/_edit_group_ = true
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_a6t6h")
animation = &"idle"
animation = &"death"
autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
+21 -9
View File
@@ -525,6 +525,8 @@ _data = {
unique_name_in_owner = true
script = ExtResource("1_77wyw")
[node name="Timer" type="Timer" parent="GameManager"]
[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource("TileSet_47g5u")
format = 2
@@ -549,13 +551,13 @@ position = Vector2(150.5, 175.5)
scale = Vector2(11.9687, 4.21875)
texture = ExtResource("9_pi0v8")
[node name="level" type="Node2D" parent="."]
[node name="Ground" type="Node2D" parent="."]
[node name="StaticBody2D" type="StaticBody2D" parent="level"]
[node name="StaticBody2D" type="StaticBody2D" parent="Ground"]
position = Vector2(48, 145)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="level/StaticBody2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/StaticBody2D"]
shape = SubResource("WorldBoundaryShape2D_xkyim")
[node name="CharacterBody2D" parent="." groups=["player"] instance=ExtResource("2_64ccm")]
@@ -564,10 +566,10 @@ PUSH_FORCE = 550
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
[node name="AreaTrigger" parent="." instance=ExtResource("7_i5ol2")]
[node name="BoxTrapTrigger" parent="." instance=ExtResource("7_i5ol2")]
position = Vector2(126, -57)
[node name="CollisionShape2D" type="CollisionShape2D" parent="AreaTrigger"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="BoxTrapTrigger"]
shape = SubResource("CircleShape2D_j8ltg")
debug_color = Color(0.72549, 0.309804, 0.905882, 0.419608)
@@ -579,10 +581,10 @@ position = Vector2(-22, -30)
[node name="boxtrap" type="Node2D" parent="crates"]
position = Vector2(131, -175)
[node name="Platform" parent="." instance=ExtResource("6_bcgm6")]
[node name="MovingPlatform" parent="." instance=ExtResource("6_bcgm6")]
position = Vector2(472, -21)
[node name="AnimationPlayer" type="AnimationPlayer" parent="Platform"]
[node name="AnimationPlayer" type="AnimationPlayer" parent="MovingPlatform"]
libraries = {
"": SubResource("AnimationLibrary_36p5o")
}
@@ -591,7 +593,17 @@ autoplay = "move"
[node name="coin" parent="." instance=ExtResource("10_mo30d")]
position = Vector2(79, 88)
[node name="Area2D" parent="." instance=ExtResource("11_ghgxt")]
[node name="coin2" parent="." instance=ExtResource("10_mo30d")]
position = Vector2(177, 89)
[node name="coin3" parent="." instance=ExtResource("10_mo30d")]
position = Vector2(330, -39)
[node name="badguy" parent="." instance=ExtResource("11_ghgxt")]
position = Vector2(-28, 84)
[connection signal="areatrigger" from="AreaTrigger" to="GameManager" method="_on_area_2d_areatrigger"]
[node name="Area2D" parent="." instance=ExtResource("11_ghgxt")]
position = Vector2(270, -12)
[connection signal="timeout" from="GameManager/Timer" to="GameManager" method="_on_timer_timeout"]
[connection signal="areatrigger" from="BoxTrapTrigger" to="GameManager" method="_on_area_2d_areatrigger"]