diff options
Diffstat (limited to 'dyl.lua')
| -rw-r--r-- | dyl.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -7,7 +7,7 @@ function spawn_slashing_particle(e) -- transitions slash_animation:equipped_from(e, _slash_animation_distance) end - return slash_animation:b_type(Entities.Enemy) + return slash_animation:b_type(Entities.Particle) :b_line_of_sight(e.line_of_sight) :b_position(vec2(e.position)) :b_sprite_position(vec2(position)) @@ -99,8 +99,9 @@ bow:b_type(Entities.Bow) :build() sword = entity() +_attack_burst_sec = 0.200 function sword:transition_state() - if button_just_pressed(5) and self.state == States.Equipped then + if button_just_pressed(5) and self.state == States.Equipped and self.state_stopwatch > _attack_burst_sec then self:transition_to(States.Slashing) spawn_slashing_particle(self) elseif self.state == States.Slashing and self.state_stopwatch > _slashing_timer_sec then |
