Guest User

Untitled

a guest
Oct 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 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. local xx, yy, r, theta, first_bit, second_bit, third_bit
  5. first_bit = function(self)
  6. xx = x[random(#x)]
  7. yy = random(h) + y
  8. r, theta = get_polar(xx-self.x, yy-self.y)
  9. self:change_speed(r/accel, accel)
  10. self:change_direction(theta, 1)
  11. return accel, second_bit
  12. end
  13. second_bit = function(self)
  14. self:change_speed(0, accel)
  15. return accel, third_bit
  16. end
  17. third_bit = function(self)
  18. x, other_x = other_x, x
  19. return max(120-45*rank, 0), first_bit
  20. end
  21. return max(120-45*rank, 0), first_bit
  22. end
Add Comment
Please, Sign In to add comment