Acid Posted October 2, 2015 Share Posted October 2, 2015 Hi, I built a small top down game using a static tilemap, and i would now like to go further and make the level infinite by scrolling vertically and generating bits of my map on the fly.I checked some of the threads here but did not come up with a solution to my problem, and i am now quite confused: Is it possible to achieve this the way i want to? Should i generate tilemap layers as the map scrolls and destroy them once they cross the screen limits? Was the whole tilemap thing a mistake and should i generate sprites instead? If anyone here has experience on the matter or some solutions to guide me towards my goal i would gladly listen to them Link to comment Share on other sites More sharing options...
bruno_ Posted October 2, 2015 Share Posted October 2, 2015 You can use your tilemap as background.To make it scroll use:yourSprite.tilePosition.y += yourValue; // adapt this as neededThe other bits of the map you can use sprites.Groups will probably be simpler, you create a group with all your objects and then kill and revive them as needed. Acid 1 Link to comment Share on other sites More sharing options...
Acid Posted October 2, 2015 Author Share Posted October 2, 2015 I will try that, thank you for your response Link to comment Share on other sites More sharing options...
jmp909 Posted October 2, 2015 Share Posted October 2, 2015 You can also change your TileMap sprites on the fly.. there are 2 examples here http://phaser.io/examples/v2/tilemaps/replace-tileshttp://phaser.io/examples/v2/tilemaps/swap-tiles potentially you could use this for what you need but depends what you're trying to do.. As Acid asks though, does anybody know how Tilemaps works compared to eg drawing a screen full of sprites and pooling then at the edges of the screen? I had assumed that's what Tilemaps did, but I don't know. If not have there been any performance results posted anywhere that show the performance and size limits of a TileMap? thanksJ Link to comment Share on other sites More sharing options...
jmp909 Posted October 3, 2015 Share Posted October 3, 2015 the answer to Acid's & my question above regarding drawing of tiles appears to be herehttp://www.html5gamedevs.com/topic/9356-how-are-huge-tilemaps-being-painted/ Link to comment Share on other sites More sharing options...
Recommended Posts