-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimation_end.gml
More file actions
27 lines (22 loc) · 1 KB
/
Animation_end.gml
File metadata and controls
27 lines (22 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// @description animation_end(sprite_index,image_index, rate)
/// @param {real} <sprite_index> The index of the sprite being animated
/// @param {real} <image_index> The current frame value
/// @param {real} <rate> -See Below-
/// The rate of change in frames per step if not
/// using built in image_index/image_speed.
/// Don't use if you don't think you need this. You probably don't.
function Animation_end() {
//returns true if the animation will loop this step.
//Script courtesy of PixellatedPope & Minty Python from the GameMaker subreddit discord
//https://www.reddit.com/r/gamemaker/wiki/discord
var _sprite=sprite_index;
var _image=image_index;
if(argument_count > 0) _sprite=argument[0];
if(argument_count > 1) _image=argument[1];
var _type=sprite_get_speed_type(sprite_index);
var _spd=sprite_get_speed(sprite_index)*image_speed;
if(_type == spritespeed_framespersecond)
_spd = _spd/room_speed;
if(argument_count > 2) _spd=argument[2];
return _image+_spd >= sprite_get_number(_sprite);
}