Guest User

Untitled

a guest
Oct 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. function mokou_wander(self)
  2. local x, other_x, y, h, accel = {}, {475}, 0, 120, 30
  3. for i=325,450,25 do other_x[#other_x+1] = i x[#x+1] = i+12.5 end
  4. while true do
  5. self:wait(max(120-45*rank, 0))
  6. -- Choose a random spot to wander to
  7. local xx = x[random(#x)]
  8. local yy = random(h) + y
  9. local r, theta = get_polar(xx-self.x, yy-self.y)
  10. self:change_speed(r/accel, accel)
  11. self:change_direction(theta, 1)
  12. self:wait(accel)
  13. self:change_speed(0, accel)
  14. self:wait(accel)
  15. x, other_x = other_x, x
  16. end
  17. end
Add Comment
Please, Sign In to add comment