Schwee
Member
Hey all,
My game is featuring a character (and enemies) that will have states/animations that only play a single time before returning to another state. Examples would include landing animations, sliding animations, etc. My current code is full of hacks. I know that the image_index is a float, not an int. So my code has stuff like the following:
if(image_index > 6.75) { isSliding = false; }
Edit: Just wanted to clarify that I'd use this knowing my image_speed is, let's say, .2. Aka I will definitely hit a value between 6.75 and 7.
This is a made up example but it's not too far off from what I am actually doing. I notice that this method always cuts the last frame off slightly sooner than usual. How do you guys handle your events like this? I am aware that the Animation End event exists but I don't see much documentation on it, and I'd personally rather keep this logic within my Step event (or a script of sorts) if possible.
Thanks.
My game is featuring a character (and enemies) that will have states/animations that only play a single time before returning to another state. Examples would include landing animations, sliding animations, etc. My current code is full of hacks. I know that the image_index is a float, not an int. So my code has stuff like the following:
if(image_index > 6.75) { isSliding = false; }
Edit: Just wanted to clarify that I'd use this knowing my image_speed is, let's say, .2. Aka I will definitely hit a value between 6.75 and 7.
This is a made up example but it's not too far off from what I am actually doing. I notice that this method always cuts the last frame off slightly sooner than usual. How do you guys handle your events like this? I am aware that the Animation End event exists but I don't see much documentation on it, and I'd personally rather keep this logic within my Step event (or a script of sorts) if possible.
Thanks.