diff options
| -rw-r--r-- | dyl.lua | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -56,7 +56,7 @@ function enemy() } } ) - :b_state(States.Walk) + :b_state(States.Idle) return EnemyBuilder:build() end @@ -126,16 +126,18 @@ end function sword() _particle_distance = 4 _attack_burst_sec = 0.200 - _sword_damage = { amount = 2, knockback = { magnitude = 200, time = 0.080 } } + _sword_damage = { amount = 2, knockback = { magnitude = 300, time = 0.080 } } SwordBuilder = EntityBuilder:new(World) function SwordBuilder:transition_state() if button_just_pressed(5) and self.state == States.Equipped and self.state_stopwatch > _attack_burst_sec then self:transition_to(States.Slashing) self:equip(slashing_particle(self), _particle_distance) self.damage = _sword_damage - elseif self.state == States.Slashing and self.state_stopwatch > _slashing_timer_sec then + elseif self.state == States.Slashing then self.damage = nil - self:transition_to(States.Equipped) + if (self.state_stopwatch > _slashing_timer_sec) then + self:transition_to(States.Equipped) + end end end SwordBuilder:b_type(Entities.Sword) @@ -230,7 +232,7 @@ function _init() end _step_t = time() -function _update() +function _update60() -- clear here in case we want to print to screen outside of _draw cls(0) |
