Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. image_angle -= 5
  2. moving = false
  3. movement_cooldown -= 1
  4.  
  5. if(movement_cooldown < 1 && !moving) {
  6.     movement_cooldown = 60
  7.     moving = true
  8.    
  9.     movement_index = irandom_range(0, 4);
  10.    
  11.     new_x = possible_positions_x[movement_index]
  12.     new_y = possible_positions_y[movement_index]
  13. }
  14.  
  15. if(moving) {
  16.     distance = point_distance(x, y, new_x, new_y)
  17.     if(distance > 5) {
  18.         move_towards_point(new_x, new_y, 5)
  19.     } else {
  20.         speed = 0
  21.         moving = false 
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement