28 lines
713 B
GDScript
28 lines
713 B
GDScript
extends LimboState
|
|
|
|
@export var sprite: SpineSprite
|
|
|
|
func _enter() -> void:
|
|
Messagebus.COCO_STATE.emit(self.name)
|
|
var a = sprite.get_animation_state()
|
|
if a: a.set_animation("idle", true, 0)
|
|
if agent.armed:
|
|
a.add_animation("holding/shotgun", false, 1)
|
|
|
|
func _update(delta) -> void:
|
|
var a: Player = agent
|
|
a.apply_movement(delta)
|
|
if a.velocity.x != 0 or a.velocity.z != 0:
|
|
get_root().dispatch("to_move")
|
|
if Input.is_action_pressed("Pause"):
|
|
get_root().dispatch("to_pause")
|
|
if Input.is_action_pressed("crouch"):
|
|
get_root().dispatch("to_crouch")
|
|
agent.check_jump_input(delta)
|
|
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
func _process(delta: float) -> void:
|
|
pass
|