DRONES
DRONE
IT'S ALIVE!11!!!!12@#!21
- Code:
- ---------DRONE
---------work of Thomas of Hilo, pseudonym tazinator
---------based on Trollbot by fordcars
---------follows PLAYER ships only!
---------change ship to core if you want to play Mothership :)
items = { }
function getName() -- Called once
return("Drone")
end
function main() -- This is the first code ran, after loose code
targetShip = nil
speed = .8
end
function onTick()
table.clear(items)
targetShip = findClosest(findAllObjects(items, ObjType.Ship))
if(targetShip ~= nil) then
local targetShiploc = targetShip:getLoc()
local angle = targetShip:getAngle()
if(bot:canSeePoint(targetShiploc)) then
bot:setThrust(0.6, targetShiploc ) --moves .8 speed toward point
bot:setAngle(angle)
bot:fireWeapon(Weapon.Phaser)
else
bot:setAngle(angle)
bot:fireWeapon(Weapon.Phaser)
end
end
end
IT'S ALIVE!11!!!!12@#!21
Last edited by tazinator on Thu Mar 20, 2014 4:32 pm, edited 1 time in total.
Play my new level! Two different teams fight over a nexus: One mainly defends while the other attacks! is fun
viewtopic.php?f=33&p=21002#p21002
viewtopic.php?f=33&p=21002#p21002