summaryrefslogtreecommitdiff
path: root/dyl.lua
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2026-05-17 11:53:35 -0700
committerElizabeth Hunt <me@liz.coffee>2026-05-17 11:54:05 -0700
commit661156ce988131eb4896a7af4d00a42b520305e7 (patch)
tree23b64b8f224f25aeb9c789a54da13f29c22b91c5 /dyl.lua
parent7d415c4958f584c031922ed77a3559d15bf2dc1b (diff)
downloaddyl8-661156ce988131eb4896a7af4d00a42b520305e7.tar.gz
dyl8-661156ce988131eb4896a7af4d00a42b520305e7.zip
This is REAL Artificial Intelligence and definitely REALLY COMPLICATED
Diffstat (limited to 'dyl.lua')
-rw-r--r--dyl.lua11
1 files changed, 6 insertions, 5 deletions
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)