From 6e017197f671589d054ca13ebee7ec36704e9916 Mon Sep 17 00:00:00 2001 From: Minimata Date: Fri, 1 Aug 2025 17:17:00 +0200 Subject: [PATCH] feat: integrated some assets and made a hitbox and damage reaction system --- damageable/damageable.gd | 13 + damageable/damageable.gd.uid | 1 + damageable/damageable.tscn | 6 + damageable/hitbox.gd | 9 + damageable/hitbox.gd.uid | 1 + damageable/hitbox.tscn | 8 + default_bus_layout.tres | 21 ++ ennemy/IdleMechant.png | 3 + ennemy/IdleMechant.png.import | 34 +++ ennemy/MechantVol.png | 3 + ennemy/MechantVol.png.import | 34 +++ ennemy/armored_ennemy.gd | 15 ++ ennemy/armored_ennemy.tscn | 40 ++- ennemy/black-magic-159868.mp3 | 3 + ennemy/black-magic-159868.mp3.import | 19 ++ main.gd | 2 + main.tscn | 53 ++-- player/armored_spritesheet.tres | 159 ++++-------- player/assets/DebutIdle.png | 3 + player/assets/DebutIdle.png.import | 34 +++ player/assets/RunCycle.png | 3 + player/assets/RunCycle.png.import | 34 +++ player/assets/WalkCycle.png | 3 + player/assets/WalkCycle.png.import | 34 +++ player/player.gd | 36 +-- player/player.tscn | 362 ++++++--------------------- 26 files changed, 484 insertions(+), 449 deletions(-) create mode 100644 damageable/damageable.gd create mode 100644 damageable/damageable.gd.uid create mode 100644 damageable/damageable.tscn create mode 100644 damageable/hitbox.gd create mode 100644 damageable/hitbox.gd.uid create mode 100644 damageable/hitbox.tscn create mode 100644 default_bus_layout.tres create mode 100644 ennemy/IdleMechant.png create mode 100644 ennemy/IdleMechant.png.import create mode 100644 ennemy/MechantVol.png create mode 100644 ennemy/MechantVol.png.import create mode 100644 ennemy/black-magic-159868.mp3 create mode 100644 ennemy/black-magic-159868.mp3.import create mode 100644 player/assets/DebutIdle.png create mode 100644 player/assets/DebutIdle.png.import create mode 100644 player/assets/RunCycle.png create mode 100644 player/assets/RunCycle.png.import create mode 100644 player/assets/WalkCycle.png create mode 100644 player/assets/WalkCycle.png.import diff --git a/damageable/damageable.gd b/damageable/damageable.gd new file mode 100644 index 0000000..c206658 --- /dev/null +++ b/damageable/damageable.gd @@ -0,0 +1,13 @@ +extends Node +class_name Damageable + + +@export var health = 3 +@export var hitback_velocity: float = 500 + +signal got_hit + +func damage(value: int = 0, direction: Vector2 = Vector2.UP): + health -= value + get_parent().velocity = hitback_velocity * direction + got_hit.emit() diff --git a/damageable/damageable.gd.uid b/damageable/damageable.gd.uid new file mode 100644 index 0000000..c96acd2 --- /dev/null +++ b/damageable/damageable.gd.uid @@ -0,0 +1 @@ +uid://bhbn4pngdfk7w diff --git a/damageable/damageable.tscn b/damageable/damageable.tscn new file mode 100644 index 0000000..6a97f5d --- /dev/null +++ b/damageable/damageable.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://djwoetcyvvofc"] + +[ext_resource type="Script" uid="uid://bhbn4pngdfk7w" path="res://damageable/damageable.gd" id="1_qv54c"] + +[node name="Damageable" type="Node"] +script = ExtResource("1_qv54c") diff --git a/damageable/hitbox.gd b/damageable/hitbox.gd new file mode 100644 index 0000000..87c5ee8 --- /dev/null +++ b/damageable/hitbox.gd @@ -0,0 +1,9 @@ +extends Area2D + +@export var damage = 0 +@export var hitback_direction = Vector2.UP + +func _on_body_entered(body: Node2D) -> void: + for child in body.get_children(): + if is_instance_of(child, Damageable): + child.damage(damage, hitback_direction) diff --git a/damageable/hitbox.gd.uid b/damageable/hitbox.gd.uid new file mode 100644 index 0000000..5004481 --- /dev/null +++ b/damageable/hitbox.gd.uid @@ -0,0 +1 @@ +uid://dt2lsk3je41th diff --git a/damageable/hitbox.tscn b/damageable/hitbox.tscn new file mode 100644 index 0000000..6d207d5 --- /dev/null +++ b/damageable/hitbox.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://7sqwi3lygb1u"] + +[ext_resource type="Script" uid="uid://dt2lsk3je41th" path="res://damageable/hitbox.gd" id="1_n3l2p"] + +[node name="Hitbox" type="Area2D"] +script = ExtResource("1_n3l2p") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..1bbac79 --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,21 @@ +[gd_resource type="AudioBusLayout" format=3 uid="uid://bvbt5y18xikew"] + +[resource] +bus/1/name = &"SFX" +bus/1/solo = false +bus/1/mute = false +bus/1/bypass_fx = false +bus/1/volume_db = -3.32682 +bus/1/send = &"Master" +bus/2/name = &"Ambiance" +bus/2/solo = false +bus/2/mute = false +bus/2/bypass_fx = false +bus/2/volume_db = -10.9863 +bus/2/send = &"Master" +bus/3/name = &"Music" +bus/3/solo = false +bus/3/mute = false +bus/3/bypass_fx = false +bus/3/volume_db = -6.25101 +bus/3/send = &"Master" diff --git a/ennemy/IdleMechant.png b/ennemy/IdleMechant.png new file mode 100644 index 0000000..39839b4 --- /dev/null +++ b/ennemy/IdleMechant.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:369036711f54cb64e1b15cad28d2291ed7561140453c114ebc14d58144891152 +size 951 diff --git a/ennemy/IdleMechant.png.import b/ennemy/IdleMechant.png.import new file mode 100644 index 0000000..2477229 --- /dev/null +++ b/ennemy/IdleMechant.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3g48672b8541" +path="res://.godot/imported/IdleMechant.png-ced0ec4bedd0a649c483c7992abb82fc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ennemy/IdleMechant.png" +dest_files=["res://.godot/imported/IdleMechant.png-ced0ec4bedd0a649c483c7992abb82fc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ennemy/MechantVol.png b/ennemy/MechantVol.png new file mode 100644 index 0000000..23c2a4f --- /dev/null +++ b/ennemy/MechantVol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f78bf841037d21c3e40c8e86e11c87a65744af675941a127a585b8f74438944c +size 2091 diff --git a/ennemy/MechantVol.png.import b/ennemy/MechantVol.png.import new file mode 100644 index 0000000..5a62a0e --- /dev/null +++ b/ennemy/MechantVol.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cjruk5xlt3tyn" +path="res://.godot/imported/MechantVol.png-92fe77e69a79007327da2f7de078b743.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ennemy/MechantVol.png" +dest_files=["res://.godot/imported/MechantVol.png-92fe77e69a79007327da2f7de078b743.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/ennemy/armored_ennemy.gd b/ennemy/armored_ennemy.gd index 4a2bd0c..34b223a 100644 --- a/ennemy/armored_ennemy.gd +++ b/ennemy/armored_ennemy.gd @@ -1,6 +1,11 @@ extends CharacterBody2D @onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D +@onready var time_to_finish_hit: Timer = $TimeToFinishHit +@onready var hitbox: Area2D = $Hitbox + +func _ready() -> void: + hitbox.monitoring = false func play_anim_run(): animated_sprite.play("run") @@ -10,3 +15,13 @@ func play_anim_idle(): func hit(): animated_sprite.play("hit") + time_to_finish_hit.start() + hitbox.monitoring = true + +func _on_trigger_hit_body_entered(body: Node2D) -> void: + if body.name == "Player": + hit() + +func _on_time_to_finish_hit_timeout() -> void: + play_anim_idle() + hitbox.monitoring = false diff --git a/ennemy/armored_ennemy.tscn b/ennemy/armored_ennemy.tscn index d9c3554..c70e68e 100644 --- a/ennemy/armored_ennemy.tscn +++ b/ennemy/armored_ennemy.tscn @@ -1,18 +1,52 @@ -[gd_scene load_steps=4 format=3 uid="uid://c5ruphrd8ebuu"] +[gd_scene load_steps=8 format=3 uid="uid://c5ruphrd8ebuu"] [ext_resource type="Script" uid="uid://dailpwkay2nu5" path="res://ennemy/armored_ennemy.gd" id="1_f4v0e"] [ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="1_k1sc2"] [ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="2_f4v0e"] +[ext_resource type="PackedScene" uid="uid://7sqwi3lygb1u" path="res://damageable/hitbox.tscn" id="4_e5h8j"] +[ext_resource type="AudioStream" uid="uid://c0w61do2a1hbc" path="res://ennemy/black-magic-159868.mp3" id="5_iblih"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_f4v0e"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_e5h8j"] [node name="ArmoredEnnemy" type="CharacterBody2D"] script = ExtResource("1_f4v0e") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -position = Vector2(1, -28) +position = Vector2(1, -16) sprite_frames = ExtResource("1_k1sc2") -animation = &"jump" +animation = &"idle" autoplay = "idle" [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2(0, -13) shape = ExtResource("2_f4v0e") + +[node name="TriggerHit" type="Area2D" parent="."] +collision_mask = 2 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="TriggerHit"] +position = Vector2(17, -15) +shape = SubResource("RectangleShape2D_f4v0e") + +[node name="Hitbox" parent="." instance=ExtResource("4_e5h8j")] +collision_mask = 3 +hitback_direction = Vector2(1, -1) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +position = Vector2(17, -15) +shape = SubResource("CircleShape2D_e5h8j") + +[node name="TimeToFinishHit" type="Timer" parent="."] +wait_time = 0.5 +one_shot = true + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("5_iblih") +autoplay = true +max_distance = 400.0 +bus = &"SFX" + +[connection signal="body_entered" from="TriggerHit" to="." method="_on_trigger_hit_body_entered"] +[connection signal="timeout" from="TimeToFinishHit" to="." method="_on_time_to_finish_hit_timeout"] diff --git a/ennemy/black-magic-159868.mp3 b/ennemy/black-magic-159868.mp3 new file mode 100644 index 0000000..53288a8 --- /dev/null +++ b/ennemy/black-magic-159868.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc0e582daef7c5c3df94de03acaf4a79d99aa99240143b06c52254279832736e +size 897024 diff --git a/ennemy/black-magic-159868.mp3.import b/ennemy/black-magic-159868.mp3.import new file mode 100644 index 0000000..321e327 --- /dev/null +++ b/ennemy/black-magic-159868.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://c0w61do2a1hbc" +path="res://.godot/imported/black-magic-159868.mp3-f5e04e11025cfff3fcd9a08fe133af57.mp3str" + +[deps] + +source_file="res://ennemy/black-magic-159868.mp3" +dest_files=["res://.godot/imported/black-magic-159868.mp3-f5e04e11025cfff3fcd9a08fe133af57.mp3str"] + +[params] + +loop=true +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/main.gd b/main.gd index 83db0e8..809d5fe 100644 --- a/main.gd +++ b/main.gd @@ -5,6 +5,7 @@ extends Node2D @onready var bubbles_back: TileMapLayer = $BubblesBack @onready var bubbles_interior: TileMapLayer = $BubblesInterior var active_camera: SuperCamera +@onready var opening_fade_to_black: ColorRect = $OpeningFadeToBlack @onready var opening_cutscene: AnimationPlayer = $OpeningCutscene @@ -15,6 +16,7 @@ func _ready() -> void: child.became_active.connect(on_camera_became_active) opening_cutscene.play("opening_cutscene") + opening_fade_to_black.visible = true func on_camera_became_active(camera: SuperCamera): active_camera = camera diff --git a/main.tscn b/main.tscn index e1ae091..0b18ed8 100644 --- a/main.tscn +++ b/main.tscn @@ -5,25 +5,25 @@ [ext_resource type="TileSet" uid="uid://bh31agl8bhwux" path="res://world_assets/oak_woods/ground.tres" id="2_0xm2m"] [ext_resource type="TileSet" uid="uid://dd5m4np46tpwj" path="res://world_assets/stringstar fields/starfields.tres" id="2_1bvp3"] [ext_resource type="PackedScene" uid="uid://bmng6wjt0paof" path="res://dialogues/dialogue_manager.tscn" id="2_efxa6"] -[ext_resource type="Texture2D" uid="uid://dbruj2bdtjfmd" path="res://player/assets/char_blue.png" id="3_dg77c"] +[ext_resource type="Texture2D" uid="uid://3g48672b8541" path="res://ennemy/IdleMechant.png" id="3_dg77c"] [ext_resource type="TileSet" uid="uid://y8veqkfywccf" path="res://world_assets/Cave/cave.tres" id="3_lquwl"] [ext_resource type="PackedScene" uid="uid://cwxv8xl0hi31i" path="res://camera/camera.tscn" id="4_lquwl"] +[ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="4_ycdy4"] [ext_resource type="TileSet" uid="uid://tyrwsjeq31vu" path="res://world_assets/bubbles.tres" id="6_7mycd"] -[ext_resource type="Texture2D" uid="uid://bvhu1nv5ftm5m" path="res://player/assets/red hood.png" id="8_5vw27"] [ext_resource type="PackedScene" uid="uid://c5ruphrd8ebuu" path="res://ennemy/armored_ennemy.tscn" id="9_kek77"] [ext_resource type="Texture2D" uid="uid://deu2palri4pji" path="res://ui/kenney_1-bit-input-prompts-pixel-16/tilemap_white.png" id="10_efxa6"] [sub_resource type="AtlasTexture" id="AtlasTexture_ycdy4"] atlas = ExtResource("3_dg77c") -region = Rect2(22, 24, 11, 12) +region = Rect2(12, 5, 14, 13) [sub_resource type="AtlasTexture" id="AtlasTexture_w48qg"] -atlas = ExtResource("8_5vw27") -region = Rect2(50, 66, 13, 13) +atlas = ExtResource("4_ycdy4") +region = Rect2(14, 9, 6, 6) [sub_resource type="AtlasTexture" id="AtlasTexture_kek77"] -atlas = ExtResource("8_5vw27") -region = Rect2(50, 66, 13, 13) +atlas = ExtResource("4_ycdy4") +region = Rect2(14, 9, 6, 5) [sub_resource type="AtlasTexture" id="AtlasTexture_dg77c"] atlas = ExtResource("10_efxa6") @@ -58,7 +58,7 @@ tracks/1/keys = { tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("ColorRect:color") +tracks/2/path = NodePath("OpeningFadeToBlack:color") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { @@ -78,10 +78,10 @@ tracks/0/path = NodePath("ArmoredEnnemy:position") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(11.0333, 13.0333), +"times": PackedFloat32Array(11.0333, 17), "transitions": PackedFloat32Array(1, 1), "update": 0, -"values": [Vector2(-400, 0), Vector2(-271, 0)] +"values": [Vector2(-400, 0), Vector2(-100, 0)] } tracks/1/type = "method" tracks/1/imported = false @@ -90,7 +90,7 @@ tracks/1/path = NodePath("ArmoredEnnemy") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { -"times": PackedFloat32Array(11.0333, 13.0333), +"times": PackedFloat32Array(11.0333, 17), "transitions": PackedFloat32Array(1, 1), "values": [{ "args": [], @@ -161,11 +161,11 @@ tracks/4/keys = { tracks/5/type = "method" tracks/5/imported = false tracks/5/enabled = true -tracks/5/path = NodePath("DialogueManager") +tracks/5/path = NodePath("OpeningDialogue") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/keys = { -"times": PackedFloat32Array(14.0333), +"times": PackedFloat32Array(16), "transitions": PackedFloat32Array(1), "values": [{ "args": [], @@ -175,7 +175,7 @@ tracks/5/keys = { tracks/6/type = "value" tracks/6/imported = false tracks/6/enabled = true -tracks/6/path = NodePath("ColorRect:color") +tracks/6/path = NodePath("OpeningFadeToBlack:color") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/keys = { @@ -194,20 +194,11 @@ _data = { [node name="Main" type="Node2D"] script = ExtResource("1_272bh") -[node name="DialogueManager" parent="." instance=ExtResource("2_efxa6")] +[node name="OpeningDialogue" parent="." instance=ExtResource("2_efxa6")] dialogue = "Who are you ? --- ... ---- -What are you doing here ? What do you want from me ? ---- -... ---- -Hello ? ---- -Kill... Oppression... Destroy... ---- -WHAT ??? HELP !!!" +" left_picture = SubResource("AtlasTexture_ycdy4") right_picture = SubResource("AtlasTexture_w48qg") @@ -253,6 +244,9 @@ maximum_location = 850 [node name="Player" parent="." instance=ExtResource("1_ig7tw")] +[node name="ArmoredEnnemy" parent="." instance=ExtResource("9_kek77")] +position = Vector2(-348, 0) + [node name="BubblesBack" type="TileMapLayer" parent="."] unique_name_in_owner = true visible = false @@ -306,6 +300,7 @@ layout_mode = 2 unique_name_in_owner = true layout_mode = 2 texture = SubResource("AtlasTexture_kek77") +flip_h = true [node name="NextDialogue" type="MarginContainer" parent="."] unique_name_in_owner = true @@ -331,10 +326,8 @@ size_flags_horizontal = 3 texture = SubResource("AtlasTexture_dg77c") stretch_mode = 3 -[node name="ArmoredEnnemy" parent="." instance=ExtResource("9_kek77")] -position = Vector2(-348, 0) - -[node name="ColorRect" type="ColorRect" parent="."] +[node name="OpeningFadeToBlack" type="ColorRect" parent="."] +visible = false offset_left = -322.0 offset_top = -224.0 offset_right = 318.0 @@ -346,4 +339,4 @@ libraries = { &"": SubResource("AnimationLibrary_efxa6") } -[connection signal="dialogue_ended" from="DialogueManager" to="Player" method="_on_dialogue_manager_dialogue_ended"] +[connection signal="dialogue_ended" from="OpeningDialogue" to="Player" method="_on_dialogue_manager_dialogue_ended"] diff --git a/player/armored_spritesheet.tres b/player/armored_spritesheet.tres index 13f5d53..4aeb268 100644 --- a/player/armored_spritesheet.tres +++ b/player/armored_spritesheet.tres @@ -1,111 +1,70 @@ -[gd_resource type="SpriteFrames" load_steps=23 format=3 uid="uid://i6035vm5ited"] +[gd_resource type="SpriteFrames" load_steps=13 format=3 uid="uid://i6035vm5ited"] [ext_resource type="Texture2D" uid="uid://dbruj2bdtjfmd" path="res://player/assets/char_blue.png" id="1_pbrcr"] +[ext_resource type="Texture2D" uid="uid://cjruk5xlt3tyn" path="res://ennemy/MechantVol.png" id="2_pxh46"] -[sub_resource type="AtlasTexture" id="AtlasTexture_8pxes"] +[sub_resource type="AtlasTexture" id="AtlasTexture_pxh46"] atlas = ExtResource("1_pbrcr") -region = Rect2(0, 56, 56, 56) +region = Rect2(112, 280, 56, 56) -[sub_resource type="AtlasTexture" id="AtlasTexture_fmu53"] +[sub_resource type="AtlasTexture" id="AtlasTexture_b2lu2"] atlas = ExtResource("1_pbrcr") -region = Rect2(56, 56, 56, 56) +region = Rect2(168, 280, 56, 56) -[sub_resource type="AtlasTexture" id="AtlasTexture_w7j2h"] +[sub_resource type="AtlasTexture" id="AtlasTexture_3w5np"] atlas = ExtResource("1_pbrcr") -region = Rect2(112, 56, 56, 56) +region = Rect2(224, 280, 56, 56) -[sub_resource type="AtlasTexture" id="AtlasTexture_n0b8q"] -atlas = ExtResource("1_pbrcr") -region = Rect2(168, 56, 56, 56) +[sub_resource type="AtlasTexture" id="AtlasTexture_4wqev"] +atlas = ExtResource("2_pxh46") +region = Rect2(96, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_jfgyi"] -atlas = ExtResource("1_pbrcr") -region = Rect2(224, 56, 56, 56) +[sub_resource type="AtlasTexture" id="AtlasTexture_t0xqw"] +atlas = ExtResource("2_pxh46") +region = Rect2(128, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_237xx"] -atlas = ExtResource("1_pbrcr") -region = Rect2(280, 56, 56, 56) +[sub_resource type="AtlasTexture" id="AtlasTexture_7en50"] +atlas = ExtResource("2_pxh46") +region = Rect2(64, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_wpyo2"] -atlas = ExtResource("1_pbrcr") -region = Rect2(0, 0, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_7crtr"] -atlas = ExtResource("1_pbrcr") -region = Rect2(56, 0, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_vgvch"] -atlas = ExtResource("1_pbrcr") -region = Rect2(112, 0, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_a1u5o"] -atlas = ExtResource("1_pbrcr") -region = Rect2(168, 0, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_3dxkp"] -atlas = ExtResource("1_pbrcr") -region = Rect2(224, 0, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6wior"] -atlas = ExtResource("1_pbrcr") -region = Rect2(280, 0, 56, 56) +[sub_resource type="AtlasTexture" id="AtlasTexture_dcl6h"] +atlas = ExtResource("2_pxh46") +region = Rect2(96, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_pbrcr"] atlas = ExtResource("1_pbrcr") region = Rect2(392, 168, 56, 56) -[sub_resource type="AtlasTexture" id="AtlasTexture_p5tca"] -atlas = ExtResource("1_pbrcr") -region = Rect2(0, 112, 56, 56) +[sub_resource type="AtlasTexture" id="AtlasTexture_yp8g1"] +atlas = ExtResource("2_pxh46") +region = Rect2(64, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_jbx34"] -atlas = ExtResource("1_pbrcr") -region = Rect2(56, 112, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_s3g0c"] -atlas = ExtResource("1_pbrcr") -region = Rect2(112, 112, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_35wys"] -atlas = ExtResource("1_pbrcr") -region = Rect2(168, 112, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pjwc4"] -atlas = ExtResource("1_pbrcr") -region = Rect2(224, 112, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_or4qq"] -atlas = ExtResource("1_pbrcr") -region = Rect2(280, 112, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hggc2"] -atlas = ExtResource("1_pbrcr") -region = Rect2(336, 112, 56, 56) - -[sub_resource type="AtlasTexture" id="AtlasTexture_b2j0d"] -atlas = ExtResource("1_pbrcr") -region = Rect2(392, 112, 56, 56) +[sub_resource type="AtlasTexture" id="AtlasTexture_er5ay"] +atlas = ExtResource("2_pxh46") +region = Rect2(96, 0, 32, 32) [resource] animations = [{ "frames": [{ "duration": 1.0, -"texture": SubResource("AtlasTexture_8pxes") +"texture": SubResource("AtlasTexture_pxh46") }, { "duration": 1.0, -"texture": SubResource("AtlasTexture_fmu53") +"texture": SubResource("AtlasTexture_b2lu2") }, { "duration": 1.0, -"texture": SubResource("AtlasTexture_w7j2h") +"texture": SubResource("AtlasTexture_3w5np") +}], +"loop": false, +"name": &"got_hit", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_4wqev") }, { "duration": 1.0, -"texture": SubResource("AtlasTexture_n0b8q") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jfgyi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_237xx") +"texture": SubResource("AtlasTexture_t0xqw") }], "loop": true, "name": &"hit", @@ -113,26 +72,14 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": SubResource("AtlasTexture_wpyo2") +"texture": SubResource("AtlasTexture_7en50") }, { "duration": 1.0, -"texture": SubResource("AtlasTexture_7crtr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_vgvch") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_a1u5o") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_3dxkp") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_6wior") +"texture": SubResource("AtlasTexture_dcl6h") }], "loop": true, "name": &"idle", -"speed": 8.0 +"speed": 2.0 }, { "frames": [{ "duration": 1.0, @@ -144,30 +91,12 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": SubResource("AtlasTexture_p5tca") +"texture": SubResource("AtlasTexture_yp8g1") }, { "duration": 1.0, -"texture": SubResource("AtlasTexture_jbx34") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_s3g0c") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_35wys") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_pjwc4") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_or4qq") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hggc2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_b2j0d") +"texture": SubResource("AtlasTexture_er5ay") }], "loop": true, "name": &"run", -"speed": 14.0 +"speed": 2.0 }] diff --git a/player/assets/DebutIdle.png b/player/assets/DebutIdle.png new file mode 100644 index 0000000..0334b17 --- /dev/null +++ b/player/assets/DebutIdle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90d2d75220709623e3fcb30de7a52c147c9102beaef5b2b169f03e94069c7796 +size 497 diff --git a/player/assets/DebutIdle.png.import b/player/assets/DebutIdle.png.import new file mode 100644 index 0000000..773aa4c --- /dev/null +++ b/player/assets/DebutIdle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dr5ypp4q8n2xm" +path="res://.godot/imported/DebutIdle.png-d20fa9d40d66390fd8f04dab8c840cf9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/assets/DebutIdle.png" +dest_files=["res://.godot/imported/DebutIdle.png-d20fa9d40d66390fd8f04dab8c840cf9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/player/assets/RunCycle.png b/player/assets/RunCycle.png new file mode 100644 index 0000000..21b4e97 --- /dev/null +++ b/player/assets/RunCycle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84faa69daa4ed8fce6ebb0a8a75f29236f45fdc1d3eb2c7e5f34250fddf06132 +size 1742 diff --git a/player/assets/RunCycle.png.import b/player/assets/RunCycle.png.import new file mode 100644 index 0000000..432dd3e --- /dev/null +++ b/player/assets/RunCycle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dsxvqsh3umw01" +path="res://.godot/imported/RunCycle.png-669737da4bd32c93f4786dff9477bb56.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/assets/RunCycle.png" +dest_files=["res://.godot/imported/RunCycle.png-669737da4bd32c93f4786dff9477bb56.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/player/assets/WalkCycle.png b/player/assets/WalkCycle.png new file mode 100644 index 0000000..a140e07 --- /dev/null +++ b/player/assets/WalkCycle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a6ee24a27d30ac027a0da3fecbf8f3fd50d16b6376a878bfda4aaf7153bb707 +size 716 diff --git a/player/assets/WalkCycle.png.import b/player/assets/WalkCycle.png.import new file mode 100644 index 0000000..09d2bc3 --- /dev/null +++ b/player/assets/WalkCycle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dw6tn0grt2ajc" +path="res://.godot/imported/WalkCycle.png-3dcfa4941b274ed62a1c28413d027e7e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://player/assets/WalkCycle.png" +dest_files=["res://.godot/imported/WalkCycle.png-3dcfa4941b274ed62a1c28413d027e7e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/player/player.gd b/player/player.gd index 0818ad3..41ecaa7 100644 --- a/player/player.gd +++ b/player/player.gd @@ -12,15 +12,15 @@ var jump_velocity = 400.0 var gravity_modifier = 1 @onready var knight: AnimatedSprite2D = $Knight -@onready var red_hood: AnimatedSprite2D = $RedHood +@onready var base: AnimatedSprite2D = $Base var animated_sprites = [] -var is_in_cutscene = false +var is_in_cutscene = true var current_animation = "idle" func play_anim(): - for sprite in animated_sprites: + for sprite: AnimatedSprite2D in animated_sprites: sprite.play(current_animation) func play_anim_run(): @@ -49,7 +49,7 @@ func look_right(): func _ready() -> void: animated_sprites = [ knight, - red_hood + base ] func _physics_process(delta: float) -> void: @@ -62,30 +62,30 @@ func _physics_process(delta: float) -> void: if not is_on_floor(): velocity += get_gravity() * delta * gravity_modifier - # Handle jump. - # if Input.is_action_just_pressed("ui_accept") and is_on_floor(): - # velocity.y = -jump_velocity - var direction := Input.get_axis("move_left", "move_right") if direction > 0: look_right() if direction < 0: look_left() - if velocity.x != 0: - play_anim_run() - else: - play_anim_idle() - if direction: - var smoothed_speed = speed * smoothstep(0, 1, acceleration) - velocity.x += direction * smoothed_speed - velocity.x = clampf(velocity.x, -speed, speed) + if not is_on_floor(): + current_animation = "got_hit" else: - velocity.x = move_toward(velocity.x, 0, speed) + if velocity.x != 0: + play_anim_run() + else: + play_anim_idle() + + if is_on_floor(): + if direction: + var smoothed_speed = speed * smoothstep(0, 1, acceleration) + velocity.x += direction * smoothed_speed + velocity.x = clampf(velocity.x, -speed, speed) + else: + velocity.x = move_toward(velocity.x, 0, speed) move_and_slide() - func _on_dialogue_manager_dialogue_ended() -> void: set_in_play() diff --git a/player/player.tscn b/player/player.tscn index ef8da70..13740b8 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -1,231 +1,106 @@ -[gd_scene load_steps=61 format=3 uid="uid://yvp44oauis4n"] +[gd_scene load_steps=32 format=3 uid="uid://yvp44oauis4n"] -[ext_resource type="Texture2D" uid="uid://d3t1fn35skpip" path="res://player/assets/idle sheet-Sheet.png" id="1_g1dw6"] [ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"] [ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="2_qjkh3"] -[ext_resource type="Texture2D" uid="uid://besci6tw4jtou" path="res://player/assets/itch run-Sheet sheet.png" id="2_yw30f"] -[ext_resource type="Texture2D" uid="uid://lew1m4dpw2ss" path="res://player/assets/itch jump sheet-Sheet.png" id="4_g6k8r"] +[ext_resource type="Texture2D" uid="uid://dg1okdxx73qx2" path="res://player/assets/itch hurt 2 sheet-Sheet.png" id="3_g6k8r"] +[ext_resource type="Texture2D" uid="uid://dr5ypp4q8n2xm" path="res://player/assets/DebutIdle.png" id="4_rgyib"] +[ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="5_boad6"] +[ext_resource type="PackedScene" uid="uid://djwoetcyvvofc" path="res://damageable/damageable.tscn" id="5_g6k8r"] [ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="5_qjkh3"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_g6k8r"] -atlas = ExtResource("1_g1dw6") -region = Rect2(0, 0, 80, 80) +[ext_resource type="Texture2D" uid="uid://dw6tn0grt2ajc" path="res://player/assets/WalkCycle.png" id="5_rgyib"] [sub_resource type="AtlasTexture" id="AtlasTexture_boad6"] -atlas = ExtResource("1_g1dw6") +atlas = ExtResource("3_g6k8r") region = Rect2(80, 0, 80, 80) [sub_resource type="AtlasTexture" id="AtlasTexture_rgyib"] -atlas = ExtResource("1_g1dw6") +atlas = ExtResource("3_g6k8r") region = Rect2(160, 0, 80, 80) [sub_resource type="AtlasTexture" id="AtlasTexture_hg6s5"] -atlas = ExtResource("1_g1dw6") +atlas = ExtResource("3_g6k8r") region = Rect2(240, 0, 80, 80) [sub_resource type="AtlasTexture" id="AtlasTexture_8t03j"] -atlas = ExtResource("1_g1dw6") +atlas = ExtResource("3_g6k8r") region = Rect2(320, 0, 80, 80) -[sub_resource type="AtlasTexture" id="AtlasTexture_2ieo8"] -atlas = ExtResource("1_g1dw6") -region = Rect2(400, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ebec5"] -atlas = ExtResource("1_g1dw6") -region = Rect2(480, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_yllr7"] -atlas = ExtResource("1_g1dw6") -region = Rect2(560, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kb6p2"] -atlas = ExtResource("1_g1dw6") -region = Rect2(640, 0, 80, 80) - [sub_resource type="AtlasTexture" id="AtlasTexture_wodsf"] -atlas = ExtResource("1_g1dw6") -region = Rect2(720, 0, 80, 80) +atlas = ExtResource("4_rgyib") +region = Rect2(0, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_32hag"] -atlas = ExtResource("1_g1dw6") -region = Rect2(800, 0, 80, 80) +atlas = ExtResource("4_rgyib") +region = Rect2(32, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_tqiix"] -atlas = ExtResource("1_g1dw6") -region = Rect2(880, 0, 80, 80) +[sub_resource type="AtlasTexture" id="AtlasTexture_2ieo8"] +atlas = ExtResource("5_rgyib") +region = Rect2(0, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_e7oew"] -atlas = ExtResource("1_g1dw6") -region = Rect2(960, 0, 80, 80) +[sub_resource type="AtlasTexture" id="AtlasTexture_ebec5"] +atlas = ExtResource("5_rgyib") +region = Rect2(32, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_c35mf"] -atlas = ExtResource("1_g1dw6") -region = Rect2(1040, 0, 80, 80) +[sub_resource type="AtlasTexture" id="AtlasTexture_yllr7"] +atlas = ExtResource("5_rgyib") +region = Rect2(64, 0, 32, 32) -[sub_resource type="AtlasTexture" id="AtlasTexture_65viv"] -atlas = ExtResource("1_g1dw6") -region = Rect2(1120, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_x7c3f"] -atlas = ExtResource("1_g1dw6") -region = Rect2(1200, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_bjvpn"] -atlas = ExtResource("1_g1dw6") -region = Rect2(1280, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_s7qer"] -atlas = ExtResource("1_g1dw6") -region = Rect2(1360, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mmwog"] -atlas = ExtResource("4_g6k8r") -region = Rect2(0, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_8pxes"] -atlas = ExtResource("4_g6k8r") -region = Rect2(80, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_fmu53"] -atlas = ExtResource("4_g6k8r") -region = Rect2(320, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_w7j2h"] -atlas = ExtResource("4_g6k8r") -region = Rect2(400, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_n0b8q"] -atlas = ExtResource("4_g6k8r") -region = Rect2(480, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jfgyi"] -atlas = ExtResource("4_g6k8r") -region = Rect2(640, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_237xx"] -atlas = ExtResource("4_g6k8r") -region = Rect2(720, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_wpyo2"] -atlas = ExtResource("4_g6k8r") -region = Rect2(960, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_7crtr"] -atlas = ExtResource("4_g6k8r") -region = Rect2(1120, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_vgvch"] -atlas = ExtResource("4_g6k8r") -region = Rect2(1200, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_a1u5o"] -atlas = ExtResource("4_g6k8r") -region = Rect2(1360, 0, 80, 80) +[sub_resource type="AtlasTexture" id="AtlasTexture_kb6p2"] +atlas = ExtResource("5_rgyib") +region = Rect2(96, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_g4c7l"] -atlas = ExtResource("2_yw30f") -region = Rect2(0, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(0, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_knn7v"] -atlas = ExtResource("2_yw30f") -region = Rect2(80, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(32, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_7pqkx"] -atlas = ExtResource("2_yw30f") -region = Rect2(160, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(64, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_uw77l"] -atlas = ExtResource("2_yw30f") -region = Rect2(240, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(96, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_rptt4"] -atlas = ExtResource("2_yw30f") -region = Rect2(320, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(128, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_r7pn3"] -atlas = ExtResource("2_yw30f") -region = Rect2(400, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(160, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_b8hi5"] -atlas = ExtResource("2_yw30f") -region = Rect2(480, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(192, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_2uvqg"] -atlas = ExtResource("2_yw30f") -region = Rect2(560, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(224, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_1s1yo"] -atlas = ExtResource("2_yw30f") -region = Rect2(640, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(256, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_5ejfk"] -atlas = ExtResource("2_yw30f") -region = Rect2(720, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(288, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_jd2rm"] -atlas = ExtResource("2_yw30f") -region = Rect2(800, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(320, 0, 32, 32) [sub_resource type="AtlasTexture" id="AtlasTexture_q28gw"] -atlas = ExtResource("2_yw30f") -region = Rect2(880, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ge24q"] -atlas = ExtResource("2_yw30f") -region = Rect2(960, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pnw6m"] -atlas = ExtResource("2_yw30f") -region = Rect2(1040, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_1so5t"] -atlas = ExtResource("2_yw30f") -region = Rect2(1120, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_55jnj"] -atlas = ExtResource("2_yw30f") -region = Rect2(1200, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dx5ib"] -atlas = ExtResource("2_yw30f") -region = Rect2(1280, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_a2xo5"] -atlas = ExtResource("2_yw30f") -region = Rect2(1360, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_art4l"] -atlas = ExtResource("2_yw30f") -region = Rect2(1440, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_fjxoa"] -atlas = ExtResource("2_yw30f") -region = Rect2(1520, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gswnw"] -atlas = ExtResource("2_yw30f") -region = Rect2(1600, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_xcnuv"] -atlas = ExtResource("2_yw30f") -region = Rect2(1680, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_j55il"] -atlas = ExtResource("2_yw30f") -region = Rect2(1760, 0, 80, 80) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hjies"] -atlas = ExtResource("2_yw30f") -region = Rect2(1840, 0, 80, 80) +atlas = ExtResource("5_boad6") +region = Rect2(352, 0, 32, 32) [sub_resource type="SpriteFrames" id="SpriteFrames_mmwog"] animations = [{ "frames": [{ "duration": 1.0, -"texture": SubResource("AtlasTexture_g6k8r") -}, { -"duration": 1.0, "texture": SubResource("AtlasTexture_boad6") }, { "duration": 1.0, @@ -236,7 +111,23 @@ animations = [{ }, { "duration": 1.0, "texture": SubResource("AtlasTexture_8t03j") +}], +"loop": false, +"name": &"got_hit", +"speed": 10.0 }, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_wodsf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_32hag") +}], +"loop": true, +"name": &"idle", +"speed": 3.0 +}, { +"frames": [{ "duration": 1.0, "texture": SubResource("AtlasTexture_2ieo8") }, { @@ -248,75 +139,10 @@ animations = [{ }, { "duration": 1.0, "texture": SubResource("AtlasTexture_kb6p2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_wodsf") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_32hag") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_tqiix") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_e7oew") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_c35mf") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_65viv") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_x7c3f") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_bjvpn") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_s7qer") -}], -"loop": true, -"name": &"idle", -"speed": 13.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_mmwog") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_8pxes") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_fmu53") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_w7j2h") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_n0b8q") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jfgyi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_237xx") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_wpyo2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_7crtr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_vgvch") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_a1u5o") }], "loop": true, "name": &"jump", -"speed": 10.0 +"speed": 4.0 }, { "frames": [{ "duration": 1.0, @@ -354,69 +180,39 @@ animations = [{ }, { "duration": 1.0, "texture": SubResource("AtlasTexture_q28gw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ge24q") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_pnw6m") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_1so5t") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_55jnj") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dx5ib") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_a2xo5") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_art4l") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_fjxoa") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_gswnw") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_xcnuv") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_j55il") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hjies") }], "loop": true, "name": &"run", -"speed": 30.0 +"speed": 14.0 }] [node name="Player" type="CharacterBody2D"] collision_layer = 3 script = ExtResource("1_yw30f") -speed = 200.0 +speed = 180.0 acceleration = 0.177 +[node name="AudioListener2D" type="AudioListener2D" parent="."] +current = true + [node name="Knight" type="AnimatedSprite2D" parent="."] visible = false position = Vector2(1, -28) sprite_frames = ExtResource("2_qjkh3") -animation = &"idle" +animation = &"jump" autoplay = "idle" -[node name="RedHood" type="AnimatedSprite2D" parent="."] -position = Vector2(11, -19) +[node name="Base" type="AnimatedSprite2D" parent="."] +position = Vector2(0, -16) sprite_frames = SubResource("SpriteFrames_mmwog") animation = &"jump" autoplay = "idle" -frame_progress = 0.749354 +frame_progress = 0.808295 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] visible = false position = Vector2(0, -13) shape = ExtResource("5_qjkh3") + +[node name="Damageable" parent="." instance=ExtResource("5_g6k8r")] +hitback_velocity = 400.0