summaryrefslogtreecommitdiff
path: root/dyl.lua
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2026-04-26 16:12:38 -0700
committerElizabeth Hunt <me@liz.coffee>2026-04-26 16:12:38 -0700
commitc8444758afa213ed89c9cf6d4793bd7812b0b734 (patch)
tree855876aa7fc99b5982c90a7295050a6dc3014b6c /dyl.lua
parenta81b080cc830d3073fda40ec777ab24f72cacfb9 (diff)
downloaddyl8-c8444758afa213ed89c9cf6d4793bd7812b0b734.tar.gz
dyl8-c8444758afa213ed89c9cf6d4793bd7812b0b734.zip
Checkpoint
Diffstat (limited to 'dyl.lua')
-rw-r--r--dyl.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/dyl.lua b/dyl.lua
index 6a337cd..e379ae3 100644
--- a/dyl.lua
+++ b/dyl.lua
@@ -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