re-implement i-frames (closes #103)

This commit is contained in:
Haze Weathers 2023-05-23 12:38:59 -04:00
parent 5413d8aa5f
commit b1a736745c
3 changed files with 12 additions and 2 deletions

View file

@ -8,6 +8,8 @@ const ArrowProjectile = preload("res://objects/player/arrow_projectile.tscn")
const DeathSplatter = preload("res://objects/player/player_death_particles.tscn")
# EXPORTS #
## whether to be temporarily invulnerable after respawning
export var use_iframes: bool = false
## horizontal movement speed
export var walk_speed: float = 50.0
## frames until walk speed peak (at 60fps reference)
@ -26,8 +28,7 @@ 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
@ -63,6 +64,7 @@ func _ready() -> void:
# set up state chart
state_chart.initialize()
state_chart.set_guard_property("can_respawn", true)
state_chart.set_guard_property("use_iframes", use_iframes)
# state chart debug
$StateDebugLayer/StateChartDebug.target = state_chart