diff options
Diffstat (limited to 'dyl.lua')
| -rw-r--r-- | dyl.lua | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -152,7 +152,7 @@ end function sword() _particle_distance = 4 - _attack_burst_sec = 0.200 + _attack_burst_sec = 0.300 _sword_damage = { amount = 2, knockback = { magnitude = 300, time = 0.080 } } SwordBuilder = EntityBuilder:new(World) function SwordBuilder:transition_state() @@ -167,7 +167,7 @@ function sword() end end end - SwordBuilder:b_type(Entities.Sword) + return SwordBuilder:b_type(Entities.Sword) :b_line_of_sight(vec2(1, 0)) :b_position(vec2(-50, 20)) :b_render_order(0) @@ -200,7 +200,7 @@ function sword() } ) :b_state(States.Idle) - return SwordBuilder:build() + :build() end function block(pos, sprite) @@ -291,12 +291,13 @@ end building(vec2(10, -90)) _enemy = enemy() +_enemy.controller = AiController:new(_enemy) _sword = sword() _wife = wife() -- _bow = bow() _fire = fire() _player = player() --- _player:equip(_sword) +_enemy.controller:follow(_player) _walk_speed = 35 -- powerup increase? function handle_input() @@ -323,7 +324,7 @@ function resume() _continue = true _step_t = time() end -function _update60() +function _update() -- clear here in case we want to print to screen outside of _draw cls(0) |
