Hi @darzu! I’ve been searching through all these kinds of chats looking for some chat that talks about this extension. (jk. when i searched it up, this was the first thing that popped up. lol) well…
I’ve been working with the extension and was wondering how to use it.
Yeah it works! I’m going to work out some kinks to make the minimap pop and the tilemap disappearing and when I press A again, I will make the minimap disappear and the tilemap pop
I am trying to make it for a 160x120 tilemap with a 1/16 scale to get 1x1 tiles. I know there is a way to get 1x1 tiles in JavaScript, but I am having trouble with it. I am also having trouble with the minimap. Help?
We could theoretically add support for 4x4 or 2x2 but I’m not sure how bad that would make performance; smaller tiles are always going to require more resources because there are more tiles to be overlapped with and more things to draw to the screen. 8x8 works great though, so maybe 4x4 wouldn’t be too bad.
For what it’s worth, we just pass in an enum mapping 8x8 to 3 and never actually check it / do anything special that I remember; if someone wants they can probably test it pretty easily with the color-coded-tilemaps extension, just pass in 2 instead of the enum for scale here. I’d suspect 4x4 might work, I think I remember adding some bumping logic that expects at least 1 or 2 pixels of space to push players back from walls that might cause weird issues though.
To update the minimap, you need to constantly draw to it in “on game update”. (1)
To reset the minimap, you need to reassign it in on game update. (2)
To show the minimap, you need to get its image every time it changes (in on game update). (3)
If you leave out step 2, then you’ll see a trail where your sprite moved which is sometimes what you want:
If you change the game update interval, you’ll get dots across a map which is what I originally used the minimap for:
Also I think performance is going to be an issue since it’s redrawing the 160x120 tiles as scaled down versions to the minimap every frame. I can probably add some optimized code to make this very fast in the case where we’re sampling one pixel and/or the whole tilemap is a uniform color. (https://github.com/microsoft/arcade-minimap/issues/3)