Lephisto/scripts/ai/test.lua
Allanis acf4150079 [Add] Per pixel collision.
[Fix] Fleets now start at random location.
    -- Still needs improvement.
2013-02-08 18:29:07 +00:00

21 lines
340 B
Lua

-- Required control rate.
control_rate = 2
-- Required "control" function.
function control()
say("IMA KILL YOU!!")
pushtask(0, "attack")
end
function attack()
target = 0
dir = face(target)
dist = getdist(getpos(target))
if dir < 10 and dist > 300 then
accel()
elseif dir < 10 and dist < 300 then
shoot()
end
end