Week 6: player health, damage animation, enemy damage
This commit is contained in:
1 parent
94ad4f45cc
commit
77eccef08c
20 files changed
+416
-34
No files matched your search
+2
-1
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://cy02yf4v8q5v6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://wmy17yj81te8" path="res://bullet.gd" id="1_mkf8s"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwn36dqvridjp" path="res://assets/graphics/projectiles/pixel_bullet.png" id="2_y25gk"]
|
||||
[ext_resource type="Texture2D" uid="uid://c1a615uhr2yfd" path="res://assets/graphics/projectiles/pixel_bullet.png" id="2_y25gk"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y25gk"]
|
||||
size = Vector2(34, 8)
|
||||
@@ -19,4 +19,5 @@ position = Vector2(-8, 5)
|
||||
scale = Vector2(-0.25, 0.225)
|
||||
texture = ExtResource("2_y25gk")
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
+8
-3
@@ -1,5 +1,6 @@
|
||||
[gd_scene load_steps=18 format=4 uid="uid://bvs868ncmeoj5"]
|
||||
[gd_scene load_steps=19 format=4 uid="uid://bvs868ncmeoj5"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b41kay5ja3tlt" path="res://scenes/ui.tscn" id="1_kvuet"]
|
||||
[ext_resource type="Script" uid="uid://bijvpac45v6s1" path="res://scripts/scene_manager.gd" id="2_lbhrr"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5a5u2c250g6" path="res://scenes/player.tscn" id="2_lnu2h"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsw50wv55u4rt" path="res://assets/graphics/terrain/vegetation/mushroom_32x64.png" id="3_0tnpc"]
|
||||
@@ -386,6 +387,10 @@ sources/2 = SubResource("TileSetAtlasSource_dinhu")
|
||||
|
||||
[node name="Game" type="Node2D"]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Control" parent="CanvasLayer" instance=ExtResource("1_kvuet")]
|
||||
|
||||
[node name="SceneManager" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_lbhrr")
|
||||
@@ -474,10 +479,10 @@ position = Vector2(391, 92)
|
||||
[node name="Enemies" type="Node2D" parent="."]
|
||||
|
||||
[node name="e1" parent="Enemies" instance=ExtResource("12_dinhu")]
|
||||
position = Vector2(376, 525)
|
||||
position = Vector2(356, 519)
|
||||
|
||||
[node name="e2" parent="Enemies" instance=ExtResource("12_dinhu")]
|
||||
position = Vector2(536, 110)
|
||||
position = Vector2(478, 78)
|
||||
|
||||
[connection signal="triggerFired" from="Triggers/Trigger" to="." method="_on_trigger_trigger_fired"]
|
||||
[connection signal="triggerFired" from="Triggers/Trigger2" to="." method="_on_trigger_trigger_fired"]
|
||||
|
||||
+113
-3
@@ -1,18 +1,76 @@
|
||||
[gd_scene load_steps=35 format=3 uid="uid://c5a5u2c250g6"]
|
||||
[gd_scene load_steps=51 format=3 uid="uid://c5a5u2c250g6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3vqmu6nc4gb0" path="res://scripts/player.gd" id="1_3vyb7"]
|
||||
[ext_resource type="Texture2D" uid="uid://de6p78arhau1m" path="res://assets/graphics/player/jump/player jump 48x48.png" id="2_dqkch"]
|
||||
[ext_resource type="Texture2D" uid="uid://bf0ysio1qxdu" path="res://assets/graphics/player/death/Player Death 64x64.png" id="2_fjrip"]
|
||||
[ext_resource type="Texture2D" uid="uid://dv34fblpejy5x" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_g2els"]
|
||||
[ext_resource type="Texture2D" uid="uid://bs8k1b6xj3gxb" path="res://assets/graphics/player/run/player run 48x48.png" id="3_qhqgy"]
|
||||
[ext_resource type="Texture2D" uid="uid://bkgyjj5bbx7r0" path="res://assets/graphics/player/melee/Player Punch 64x64.png" id="4_qlg0r"]
|
||||
[ext_resource type="Texture2D" uid="uid://cwid3ull01xog" path="res://assets/graphics/player/hurt/Player Hurt 48x48.png" id="4_smehm"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_8cj0n"]
|
||||
radius = 21.2132
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pf23h"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dt7fs"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wqfne"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wnwbv"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(144, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gl8cc"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(192, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_487ah"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(240, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_md1ol"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(288, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bj30b"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(336, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jc3p3"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(384, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hax0n"]
|
||||
atlas = ExtResource("2_fjrip")
|
||||
region = Rect2(432, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i4ail"]
|
||||
atlas = ExtResource("2_dqkch")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t4otl"]
|
||||
atlas = ExtResource("4_smehm")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j2b1d"]
|
||||
atlas = ExtResource("4_smehm")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cs1tg"]
|
||||
atlas = ExtResource("4_smehm")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2dvfe"]
|
||||
atlas = ExtResource("4_smehm")
|
||||
region = Rect2(144, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qhqgy"]
|
||||
atlas = ExtResource("2_g2els")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
@@ -113,6 +171,41 @@ region = Rect2(336, 0, 48, 48)
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pf23h")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dt7fs")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wqfne")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_wnwbv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gl8cc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_487ah")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_md1ol")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bj30b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jc3p3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hax0n")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"death",
|
||||
"speed": 12.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_i4ail")
|
||||
}],
|
||||
"loop": false,
|
||||
@@ -121,6 +214,23 @@ animations = [{
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_t4otl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j2b1d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cs1tg")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2dvfe")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"hurt",
|
||||
"speed": 12.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qhqgy")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
@@ -251,8 +361,8 @@ one_shot = true
|
||||
texture_filter = 1
|
||||
position = Vector2(1, -1)
|
||||
sprite_frames = SubResource("SpriteFrames_jej6c")
|
||||
animation = &"melee"
|
||||
autoplay = "idle"
|
||||
animation = &"death"
|
||||
autoplay = "death"
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
offset = Vector2(0, -20)
|
||||
|
||||
+35
-3
@@ -1,8 +1,24 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://b2lq6rp0aht6d"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://b2lq6rp0aht6d"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cn1jvyyvb3g3c" path="res://assets/graphics/enemies/slime_green.png" id="1_371uh"]
|
||||
[ext_resource type="Script" uid="uid://bsmcx4pr1imsq" path="res://scripts/slime.gd" id="1_p2gj0"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fd6lc"]
|
||||
atlas = ExtResource("1_371uh")
|
||||
region = Rect2(0, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gstla"]
|
||||
atlas = ExtResource("1_371uh")
|
||||
region = Rect2(24, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v5wyi"]
|
||||
atlas = ExtResource("1_371uh")
|
||||
region = Rect2(48, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0l8pv"]
|
||||
atlas = ExtResource("1_371uh")
|
||||
region = Rect2(72, 48, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p2gj0"]
|
||||
atlas = ExtResource("1_371uh")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
@@ -23,6 +39,23 @@ region = Rect2(72, 24, 24, 24)
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fd6lc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gstla")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v5wyi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0l8pv")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"hurt",
|
||||
"speed": 12.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_p2gj0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
@@ -48,9 +81,8 @@ script = ExtResource("1_p2gj0")
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_fd6lc")
|
||||
animation = &"run"
|
||||
animation = &"hurt"
|
||||
autoplay = "run"
|
||||
frame_progress = 0.256611
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 4)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b41kay5ja3tlt"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cv1at33pu2ae2" path="res://scripts/ui.gd" id="1_nt7q6"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_nt7q6")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
grow_horizontal = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Health" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
text = "Health"
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Timer" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer2"]
|
||||
layout_mode = 2
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Coins" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer3"]
|
||||
layout_mode = 2
|
||||
text = "Coins"
|
||||
horizontal_alignment = 2
|
||||
Reference in new issue
Block a user