All pastes #2070002 Raw Edit

Miscellany

public text v1 · immutable
#2070002 ·published 2011-05-27 06:12 UTC
rendered paste body
local my_class = class
local my_ship = ships[my_class]
local s = sensor_contacts({})

local gotoguy = nil
for k, v in pairs(s) do
   if (v:team() ~= team) then
      gotoguy = v
      break
   end
end

if gotoguy then printf("gotoguy at: %d, %d\n", gotoguy:position()) end

while true do
   if (gotoguy) then
      local gx, gy = gotoguy:position() -- JS: Should this recompute?
      drive_towards(10, gx, gy)
      debug_diamond(gx, gy, 12)
   end
   yield()
end