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
- while true do
- self:wait(max(120-45*rank, 0))
- -- Choose a random spot to wander to
- local xx = x[random(#x)]
- local yy = random(h) + y
- local r, theta = get_polar(xx-self.x, yy-self.y)
- self:change_speed(r/accel, accel)
- self:change_direction(theta, 1)
- self:wait(accel)
- self:change_speed(0, accel)
- self:wait(accel)
- x, other_x = other_x, x
- end
- end
Add Comment
Please, Sign In to add comment