walk anim, death anim ja loading screen

This commit is contained in:
2026-08-09 23:05:55 +03:00
parent 6414b2e7cc
commit 3cd347d420
9 changed files with 69 additions and 48 deletions
+9 -3
View File
@@ -14,7 +14,9 @@ const _ANIM_IDLE: StringName = &"Armature|IDLE"
const _ANIM_KICK: StringName = &"Armature|KICK"
const _ANIM_SLAM: StringName = &"Armature|SLAM"
const _ANIM_DASH: StringName = &"Armature|DASH"
const _ANIM_WALK: StringName = &"Armature|WALK"
const _ANIM_ROLL: StringName = &"Armature|ROLL"
const _ANIM_DEATH: StringName = &"Armature|DEATH"
@onready var camera_pivot: Node3D = $Camera3D
@onready var cube_guy: Node3D = $bull
@@ -306,9 +308,11 @@ func _update_locomotion_anim(moving: bool) -> void:
return
_locomotion_moving = moving
if moving:
if _bull_anim.has_animation(_ANIM_DASH):
_bull_anim.speed_scale = 1.0
_bull_anim.play(_ANIM_DASH, 0.25)
if _bull_anim.has_animation(_ANIM_WALK):
_bull_anim.speed_scale = 2.0
_bull_anim.play(_ANIM_WALK, 1)
var anim = _bull_anim.get_animation(_ANIM_WALK)
anim.loop_mode = Animation.LOOP_LINEAR
else:
_play_idle()
@@ -1085,6 +1089,8 @@ func take_sword_hit(cause: String = "", hit_pos: Vector3 = Vector3.ZERO) -> void
_huff_player.pitch_scale = randf_range(0.7, 0.9)
_huff_player.play()
if _hp <= 0:
if _bull_anim.current_animation != _ANIM_DEATH:
_bull_anim.play(_ANIM_DEATH)
_dead = true
died.emit(cause)