diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2026-04-26 16:12:38 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2026-04-26 16:12:38 -0700 |
| commit | c8444758afa213ed89c9cf6d4793bd7812b0b734 (patch) | |
| tree | 855876aa7fc99b5982c90a7295050a6dc3014b6c /dyl.lua | |
| parent | a81b080cc830d3073fda40ec777ab24f72cacfb9 (diff) | |
| download | dyl8-c8444758afa213ed89c9cf6d4793bd7812b0b734.tar.gz dyl8-c8444758afa213ed89c9cf6d4793bd7812b0b734.zip | |
Checkpoint
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 |
