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