In Phaser 3, what is the best way to draw a minimap?
I’m working on a Metroidvania type game, and the game is one large level consisting of several connected single screens. Although creating a mini map for one large scrolling map would technically be the same question.
The player can look at the mini-map anytime during gameplay, and the game will pause and the map will overlay on the game area. After that the player can press a button to close it and continue playing.
See this game as an example. It’s not my game btw it’s just a very good example.
The map doesn’t have to be that detailed, just a couple of pixels per screen. It would have to draw each screen based on the level data. Not all screens will be drawn initially, my game keeps track of which rooms have been visited and only those should be draw into the map.
So the map changes sometimes, but not very often, so there is definitely no need to redraw it every frame.
Which Phaser3 game object best suited for this? I was thinking the Graphics object and then use generateTexture
.But then, can it be updated once it is a texture? And should I just re-draw and destroy the map object every time the player want to see it? Or is it better to re-use it once it is created, keep the map object off screen, make it invisible, and slide it into screen whenever needed?