summaryrefslogtreecommitdiff
path: root/dyl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dyl.lua')
-rw-r--r--dyl.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/dyl.lua b/dyl.lua
index a1174a9..e0914bd 100644
--- a/dyl.lua
+++ b/dyl.lua
@@ -9,7 +9,7 @@ function slashing_particle(following)
:b_sprite_position(vec2(following.sprite_position))
:b_line_of_sight(vec2(following.line_of_sight))
:b_add_state(
- States.Active, {
+ States.Equipped, {
animation = {
pos_y = { sequence = { 115, 116, 117 }, dt = _slashing_timer_sec / 3, reflect = vec2(true, true) },
neg_y = { sequence = { 115, 116, 117 }, dt = _slashing_timer_sec / 3 },
@@ -18,7 +18,7 @@ function slashing_particle(following)
}
}
)
- :b_state(States.Active)
+ :b_state(States.Equipped)
function SlashingParticleBuilder:transition_state()
end
@@ -167,14 +167,11 @@ function sword()
}
)
:b_state(States.Equipped)
- return SwordBuilder:build()
+ e = SwordBuilder:build()
+ assert(e.states[States.Equipped])
+ return e
end
-_enemy = enemy()
-_sword = sword()
-_wife = wife()
-_bow = bow()
-
function player()
PlayerBuilder = EntityBuilder:new(World)
function PlayerBuilder:transition_state()
@@ -214,10 +211,15 @@ function player()
:b_state(States.Idle)
return PlayerBuilder:build()
end
+
+_enemy = enemy()
+_sword = sword()
+_wife = wife()
+_bow = bow()
_player = player()
_player:equip(_sword)
-_walk_speed = 35 -- powerup increase?
+_walk_speed = 40 -- powerup increase?
function handle_input()
dpos = vec2(0, 0)
if btn(0) then dpos.x -= 1 end