GameMaker Pausing animated tiles

S

Space

Guest
Is it possible to stop the animation of animated tiles when the game is paused? if so, how might that be done?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Currently you'd need to loop through the tiles and replace the one being used for a static one or set the frame index for the tile to 0 every step that the game is paused. You could also make your own animation system and draw and keep track of the tiles yourself. That way you can control everything about the tiles...

Note that there is a bug in the database to make this simpler and permit the pausing of whole tilemaps.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
would you please tell us the bug?
I can't post a link as it's in the private DB, but the text for the bug report reads:

If you want to pause your game and stop all animation, then you have a problem when it comes to tilemaps as there is no way to pause animating tiles all at once. You need to loop through all tiles and then set the tile index to 0 every step (there is no way to set the animation speed of a tilemap at runtime).In fact, there is no way to get or set the animation speed for a given tilemap layer at all...

So I'd suggest that we add the following functions:

tilemap_image_speed(tile map, speed)
tilemap_get_image_speed(tile map)

I would also suggest a more general set of functions:

tilemap_pause();
tilemap_unpause();

which would simply pause ALL the tiles on ALL tilemap layers and then unpause them ALL again. Very handy for when you have to pause the game and you have multiple tilemaps in the room editor.
It's been accepted so sometime in the future we'll get this functionality, but it may be a while yet...
 
Top