they are autistic

This commit is contained in:
Haze Weathers 2023-05-10 18:55:04 -04:00
parent 3ba9afd2be
commit 65e1d2f015
2 changed files with 181 additions and 8 deletions

View file

@ -24,7 +24,8 @@ export var jump_force: float = 150.0
export var jump_release_force: float = 0.25
## impulse added when double jumping
export var double_jump_force: float = 122.0
## blinking time
export var blinking_time: float = 10.0
# velocity
var velocity: Vector2 = Vector2.ZERO
@ -112,6 +113,21 @@ func _on_Grounded_state_entered() -> void:
snap.y = 2.5 # snap when in grounded state
velocity.y = 1.0
func _on_Still_state_entered() -> void:
animation_player.play("idle")
func _on_Walking_state_entered() -> void:
animation_player.play("walk")
func _on_Blinking_state_entered() -> void:
if $"%Blinking".active:
animation_player.play("blink")
var blink_timer = get_tree().create_timer(rand_range(0.2, 1.0), false)
blink_timer.connect("timeout", self,"_on_Blinking_state_entered")
func _on_Stimming_state_entered() -> void:
animation_player.play("stim")
func _on_Pushing_state_entered() -> void:
animation_player.play("push")
@ -216,9 +232,9 @@ func _process_horizontal_movement(delta: float) -> void:
## walk/idle state
func _process_can_walk(delta: float) -> void:
if sign(Input.get_axis("ui_left", "ui_right")) != 0.0:
animation_player.play("walk")
state_chart.send_event("walk_start")
else:
animation_player.play("idle")
state_chart.send_event("walk_stop")
## rubbing up against a wall or pushing an object
func _process_pushing(delta: float) -> void: