From 661156ce988131eb4896a7af4d00a42b520305e7 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 17 May 2026 11:53:35 -0700 Subject: This is REAL Artificial Intelligence and definitely REALLY COMPLICATED --- dyl.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dyl.lua') diff --git a/dyl.lua b/dyl.lua index 398a6f7..116315b 100644 --- a/dyl.lua +++ b/dyl.lua @@ -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) -- cgit v1.3