Advertisement
Rochet2

Go Forward +Degrees edition

Mar 23rd, 2012
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.26 KB | None | 0 0
  1. function Forward(pUnit, dist, Deg) -- left = 90 | right = -90
  2.     if(not pUnit or not dist) then return nil end
  3.     local o = pUnit:GetO() - math.pi/2
  4.     if(Deg) then o = o + math.rad(Deg) end
  5.     return pUnit:GetX()-(dist*math.sin(o)), pUnit:GetY()+(dist*math.cos(o))
  6. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement