I’ve been experimenting with a minimap extension: https://github.com/microsoft/arcade-minimap
I extended stream 21 to include a minimap: https://makecode.com/_cfmFVq27UbsL
also added some wind.
It’s useful for having a smaller representation of the tilemap.
Here are the blocks:
and in action (notice the scale parameters):
cute! Does it actually draw from the same tilemap object?
Yes it’s created from the current tilemap and can be modified by drawing sprites onto it
@darzu you should add blocks for setting the colors. Like: draw ‘tile’ as ‘color’
Just discovered this extension and it’s awesome. Thanks for making this @darzu!
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.
I wanted to work with the Minimaps but I can’t just figure it out. Can you help me?
Heres the link: https://makecode.com/_UcXCAjEawCa2
It’s been making errors. Is it because I’m using the older version instead of beta?
Hey @Dreadmask197, glad you’re interested! It’s one little thing: the myMinimap variable needs to take a “minimap” not the image from the minimap.
Here’s a gif showing the fix:
Here’s a fixed version:
hope that helps!
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 figured the minimap stuff and the pop ups!! It took me a while but I got it.
Thanks a million!
Awesome! Can’t wait to play your game!
Could you post your code, please? Maybe you’re just missing something.
@GameGod the smallest tile size is 8x8.
Complete list of tile size options is:
The reason it’s limited is because it is much, much, much faster if the tile size is a power of 2.
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.
How would I erase the sprite and draw it moving?
Here’s an updated version:
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:
Wow. That’s pretty cool with the letters as well. Do you use an app to make gifs? I don’t know where to download one.
Thinking about it, this scenario of real-time updating a minimap is very common and we could probably add some blocks to make this easier.
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)
On mac I use gifox. Windows folks use ScreenToGif I think