speed boost for tile-based webgames

Monkey Forums/Monkey Code/speed boost for tile-based webgames

slenkar(Posted 2012) [#1]
ilovepixel created the grabimage from canvas function and it does speed up rendering a tile map quite a lot

only for flash and html5 so far:

http://www.slenkar.herobo.com/tilegrab/flash/monkeygame.html
http://www.slenkar.herobo.com/tilegrab/html5/monkeygame.html

at first it is rendering the tilemap the normal way drawing individual images chosen from an array (for max speed)

when you press space it will switch to grabbing the screen,

press the right arrow to scroll the map to the right



basically you draw the tiles if no image is grabbed
if the image is null grab the screen
then if the camera goes right, change the x value of the grabbed image by -1
if the grabbed image is at position -8 or -tile_size null the image