summaryrefslogtreecommitdiff
path: root/dyl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dyl.lua')
-rw-r--r--dyl.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/dyl.lua b/dyl.lua
index 70325c3..8c5f8a2 100644
--- a/dyl.lua
+++ b/dyl.lua
@@ -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)