feat: them skeletons man + reload after dancing
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 5s
Create tag and build when new code gets to main / Export (push) Successful in 2m12s

This commit is contained in:
2025-08-02 23:57:02 +02:00
parent eda35b4e9b
commit 3e0f1c99d5
9 changed files with 851 additions and 9 deletions

View File

@ -11,6 +11,9 @@ var jump_velocity = 400.0
@export_range(0, 10, 0.1, "or_greater")
var gravity_modifier = 1
@onready var hitting: Timer = $Hitting
@onready var hitbox: Area2D = $Hitbox
@onready var sword: AnimatedSprite2D = $Sword
@onready var damageable: Damageable = $Damageable
@onready var shield: AnimatedSprite2D = $Shield
@ -20,6 +23,7 @@ var current_sprite: AnimatedSprite2D
var is_in_cutscene = false # back to true on build
var current_animation = "idle"
var is_hitting = false
var has_shield = false
var has_sword = false
var has_armor = false
@ -62,6 +66,12 @@ func _physics_process(delta: float) -> void:
move_and_slide()
return
if is_hitting:
current_animation = "hit"
velocity.x = move_toward(velocity.x, 0, speed)
move_and_slide()
return
if not is_on_floor():
velocity += get_gravity() * delta * gravity_modifier
@ -95,8 +105,15 @@ func _physics_process(delta: float) -> void:
move_and_slide()
func hit():
print("hit")
current_animation = "hit"
is_hitting = true
hitting.start()
hitbox.monitorable = true
hitbox.monitoring = true
func _on_hitting_timeout() -> void:
is_hitting = false
hitbox.monitorable = false
hitbox.monitoring = false
func _on_dialogue_manager_dialogue_ended() -> void:
set_in_play()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=63 format=3 uid="uid://yvp44oauis4n"]
[gd_scene load_steps=65 format=3 uid="uid://yvp44oauis4n"]
[ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"]
[ext_resource type="Texture2D" uid="uid://dxsbbcagqkiid" path="res://player/assets/RunArmeEpee.png" id="2_hg6s5"]
@ -10,6 +10,7 @@
[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"]
[ext_resource type="PackedScene" uid="uid://7sqwi3lygb1u" path="res://damageable/hitbox.tscn" id="11_2ieo8"]
[sub_resource type="AtlasTexture" id="AtlasTexture_tqiix"]
atlas = ExtResource("3_hg6s5")
@ -234,7 +235,7 @@ animations = [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_a1u5o")
}],
"loop": true,
"loop": false,
"name": &"hit",
"speed": 12.0
}, {
@ -460,6 +461,8 @@ animations = [{
"speed": 14.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_ebec5"]
[node name="Player" type="CharacterBody2D"]
collision_layer = 3
script = ExtResource("1_yw30f")
@ -475,7 +478,8 @@ position = Vector2(0, -16)
sprite_frames = SubResource("SpriteFrames_jfgyi")
animation = &"hit"
autoplay = "idle"
frame_progress = 0.277569
frame = 5
frame_progress = 1.0
[node name="Shield" type="AnimatedSprite2D" parent="."]
visible = false
@ -497,3 +501,18 @@ shape = ExtResource("5_qjkh3")
[node name="Damageable" parent="." instance=ExtResource("5_g6k8r")]
hitback_velocity = 400.0
[node name="Hitting" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="Hitbox" parent="." instance=ExtResource("11_2ieo8")]
monitoring = false
monitorable = false
damage = 10
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(16, -10)
shape = SubResource("CircleShape2D_ebec5")
[connection signal="timeout" from="Hitting" to="." method="_on_hitting_timeout"]