feat"redhood interaction and sword getting
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 7s
Create tag and build when new code gets to main / Export (push) Successful in 2m15s

This commit is contained in:
2025-08-02 22:38:04 +02:00
parent 02f04cc38a
commit eda35b4e9b
10 changed files with 912 additions and 47 deletions

View File

@ -11,6 +11,7 @@ var jump_velocity = 400.0
@export_range(0, 10, 0.1, "or_greater")
var gravity_modifier = 1
@onready var sword: AnimatedSprite2D = $Sword
@onready var damageable: Damageable = $Damageable
@onready var shield: AnimatedSprite2D = $Shield
@onready var base: AnimatedSprite2D = $Base
@ -60,7 +61,6 @@ func _physics_process(delta: float) -> void:
velocity.x = move_toward(velocity.x, 0, speed)
move_and_slide()
return
if not is_on_floor():
velocity += get_gravity() * delta * gravity_modifier
@ -88,9 +88,16 @@ func _physics_process(delta: float) -> void:
velocity.x = clampf(velocity.x, -speed, speed)
else:
velocity.x = move_toward(velocity.x, 0, speed)
if Input.is_action_just_pressed("hit") and has_sword:
hit()
move_and_slide()
func hit():
print("hit")
current_animation = "hit"
func _on_dialogue_manager_dialogue_ended() -> void:
set_in_play()
@ -104,7 +111,14 @@ func _on_npc_shield_dialogue_dialogue_ended() -> void:
set_in_play()
current_sprite.visible = false
current_sprite = shield
shield.play("idle")
shield.visible = true
current_sprite.play("idle")
current_sprite.visible = true
has_shield = true
func _on_red_hood_sword_dialogue_dialogue_ended() -> void:
set_in_play()
current_sprite.visible = false
current_sprite = sword
current_sprite.play("idle")
current_sprite.visible = true
has_sword = true