Advertisement
Guest User

Untitled

a guest
Apr 14th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //vars to define outside of this script:
  2. //angle_index = the angle we want to use
  3. //angle_subimg = our internal image_index;
  4. //img_speed = our internal image_speed (don't use image_speed)
  5.  
  6. var angle_count=argument[0];//the number of angles contained wihin the sprite
  7. var imgdex_real=((image_number)/angle_count);//how many subimages per loop there really is
  8.  
  9.  
  10. //going through the actual subimg loop, angle_subimg defines the actual frame of animation in the loop
  11. angle_subimg+=img_speed*delta_realtime;
  12. while angle_subimg>=imgdex_real{angle_subimg-=imgdex_real};//going back to start when looped
  13. while angle_subimg<0{angle_subimg+=imgdex_real};
  14.  
  15. //finally setting image_index based on angle index + subimg
  16. image_index=(angle_index*imgdex_real)+angle_subimg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement