Advertisement
KptHashtag

AnalogMovement

Jan 11th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var xx = mouse_x
  2. var yy = mouse_y
  3.  
  4. var l_max = argument0 //max length of analog zone
  5. var s_max = argument1 //max spd of player
  6.  
  7. if((mouse_check_button(mb_left)) && (mouse_x < view_wview[0]/2) && (mouse_y < view_hview[0])){
  8.     dir = point_direction(xx,yy,mouse_x,mouse_y)
  9.     spd = l_max / (l_max/s_max)
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement