Advertisement
MichelVGameMaker

animation_end

May 18th, 2020
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///@function animation_end(stopAnimation_true_false)
  2. /// @description returns true if an animation hits the last frame
  3. /// @param stop_animation
  4. /// @credit: based on heartbeast’s code https://uheartbeast.tumblr.com/post/141086627878/animation-hit-frame-and-animation-end
  5.  
  6. if (argument_count == 1) var _stop_animation = argument[0]; // stop animation on last frame
  7. else                     var _stop_animation = false;
  8.  
  9. var _animation_over = animation_hit_frame(image_number-1);
  10. if ( _stop_animation and _animation_over )
  11. {
  12.     image_speed = 0;
  13.     image_index = image_number1;
  14. }  
  15.  
  16. return _animation_over;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement