This is just a proof-of-concept GML code thing I did for rdein. What it does is this: when you start a room, it draw all of the room's tiles to a surface or series of surfaces, then destroys the tiles. Then it draws the surfaces in place of the tiles. Drawing a few large surfaces is theoretically faster than drawing 1000s of individual tiles, each with their own specific top, left, width, and height values.
If your game involves a lot of room transitions then this may be a bit wasteful. In that case you would, in your game's final build, export the surfaces to image files, then import them back into your game and use those instead of either the tile layers or this method.
Attachment | Size |
---|---|
TileSurfacer.gmk | 85.47 KB |