Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mokou_wander(self)
- local x, other_x, y, h, accel = {}, {475}, 0, 120, 30
- for i=325,450,25 do other_x[#other_x+1] = i x[#x+1] = i+12.5 end
- local xx, yy, r, theta, first_bit, second_bit, third_bit
- first_bit = function(self)
- xx = x[random(#x)]
- yy = random(h) + y
- r, theta = get_polar(xx-self.x, yy-self.y)
- self:change_speed(r/accel, accel)
- self:change_direction(theta, 1)
- return accel, second_bit
- end
- second_bit = function(self)
- self:change_speed(0, accel)
- return accel, third_bit
- end
- third_bit = function(self)
- x, other_x = other_x, x
- return max(120-45*rank, 0), first_bit
- end
- return max(120-45*rank, 0), first_bit
- end
Add Comment
Please, Sign In to add comment