# Minimap extension beta

**URL:** https://forum.makecode.com/t/minimap-extension-beta/1709
**Category:** Arcade
**Tags:** extension
**Created:** [April 16, 2020, 2:24am UTC](https://forum.makecode.com/t/minimap-extension-beta/1709 "2020-04-16T02:24:10Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [April 16, 2020, 2:24am UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/1 "2020-04-16T02:24:10Z")

</div>

Hello world,

I’ve been experimenting with a minimap extension: [https://github.com/microsoft/arcade-minimap](https://github.com/microsoft/arcade-minimap)

 ![2020-04-15 19.19.05](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/673a074cc5c69b4013f2e70162bd688aaddbea96.gif)

I extended stream 21 to include a minimap: [https://makecode.com/\_cfmFVq27UbsL](https://makecode.com/_cfmFVq27UbsL)  
also added some wind.

It’s useful for having a smaller representation of the tilemap.

Here are the blocks:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/2efa7f6c6eb826015c26478e41a2fedca0b13c51.png)  
and in action (notice the scale parameters):

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/44f2da766873f20e10ad7049bcb3397931658c0b.png)

Cheers,  
Daryl

---

<div class="post-metadata">

### Author: ![joshmarinacci](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/joshmarinacci/32/768_2.png) [@joshmarinacci](https://forum.makecode.com/u/joshmarinacci)
#### Post date: [April 16, 2020, 3:47am UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/2 "2020-04-16T03:47:12Z")

</div>

cute! Does it actually draw from the same tilemap object?

---

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [April 16, 2020, 5:10am UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/3 "2020-04-16T05:10:08Z")

</div>

Yes it’s created from the current tilemap and can be modified by drawing sprites onto it

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [April 16, 2020, 4:31pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/4 "2020-04-16T16:31:31Z")

</div>

@darzu you should add blocks for setting the colors. Like: draw ‘tile’ as ‘color’

---

<div class="post-metadata">

### Author: ![techahoynyc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/techahoynyc/32/1023_2.png) [@techahoynyc](https://forum.makecode.com/u/techahoynyc)
#### Post date: [September 15, 2020, 10:11pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/5 "2020-09-15T22:11:17Z")

</div>

Just discovered this extension and it’s awesome. Thanks for making this @darzu!

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [October 20, 2020, 9:31pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/6 "2020-10-20T21:31:03Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f84717098bb43c39b0265b2e89916790eac785e8.png)  
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](https://makecode.com/_UcXCAjEawCa2)

It’s been making errors. Is it because I’m using the older version instead of beta?

---

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [October 21, 2020, 4:50pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/7 "2020-10-21T16:50:46Z")

</div>

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:

 ![2020-10-21 09.48.26](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/553b94b76d47235597f94f7a00096f4fc8493fcb.gif)

Here’s a fixed version:

> **[One way movement](https://arcade.makecode.com/33330-92069-25662-27486)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

hope that helps!

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [October 21, 2020, 5:18pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/8 "2020-10-21T17:18:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [October 21, 2020, 5:28pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/9 "2020-10-21T17:28:15Z")

</div>

Hey @darzu!!

> **[One way movement](https://arcade.makecode.com/58216-95313-76946-30208)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

  
I figured the minimap stuff and the pop ups!! It took me a while but I got it.

Thanks a million!  
Dreadmask197

---

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [October 21, 2020, 7:48pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/10 "2020-10-21T19:48:26Z")

</div>

Awesome! Can’t wait to play your game!

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [October 22, 2020, 9:37pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/11 "2020-10-22T21:37:00Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [October 22, 2020, 10:24pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/12 "2020-10-22T22:24:40Z")

</div>

Could you post your code, please? Maybe you’re just missing something.

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [October 22, 2020, 10:31pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/13 "2020-10-22T22:31:02Z")

</div>

@GameGod the smallest tile size is 8x8.

Complete list of tile size options is:

1. 8x8
2. 16x16
3. 32x32

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [October 22, 2020, 10:35pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/14 "2020-10-22T22:35:07Z")

</div>

The reason it’s limited is because it is much, much, much faster if the [tile size is a power of 2](https://en.wikipedia.org/wiki/Arithmetic_shift).

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.

---

<div class="post-metadata">

### Author: ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)
#### Post date: [October 22, 2020, 11:13pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/15 "2020-10-22T23:13:20Z")

</div>

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](https://github.com/microsoft/pxt-common-packages/blob/master/libs/color-coded-tilemap/tilemap.ts#L16). 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.

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [October 23, 2020, 1:33am UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/16 "2020-10-23T01:33:50Z")

</div>

How would I erase the sprite and draw it moving?

> **[Untitled](https://arcade.makecode.com/30712-07195-15422-41218)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [October 23, 2020, 5:15pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/17 "2020-10-23T17:15:35Z")

</div>

Here’s an updated version:

> **[Untitled](https://arcade.makecode.com/61370-77376-48444-19489)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7f2bc888011498f4dee0d6a4ee1749b6463082a5.png)

If you leave out step 2, then you’ll see a trail where your sprite moved which is sometimes what you want:  
 ![2020-10-23 10.13.35](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/75520028ac6eb5791b3d76a9f5f4342bb993d5fd.gif)  
If you change the game update interval, you’ll get dots across a map which is what I originally used the minimap for:  
 ![2020-10-23 10.14.27](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/5066797fb1ad20f1199d76babed8439785c00231.gif)

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [October 23, 2020, 5:23pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/18 "2020-10-23T17:23:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [October 23, 2020, 5:24pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/19 "2020-10-23T17:24:28Z")

</div>

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.

Maybe:

- change “draw mySprite on myMinimap” to say “draw mySprite once on myMinimap”
- add “track mySrpite on myMinimap”. This block would automatically keep updating the minimap whenever the sprite moves. ([https://github.com/microsoft/arcade-minimap/issues/2](https://github.com/microsoft/arcade-minimap/issues/2))

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](https://github.com/microsoft/arcade-minimap/issues/3))

---

<div class="post-metadata">

### Author: ![darzu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darzu/32/1882_2.png) [@darzu](https://forum.makecode.com/u/darzu)
#### Post date: [October 23, 2020, 5:25pm UTC](https://forum.makecode.com/t/minimap-extension-beta/1709/20 "2020-10-23T17:25:15Z")

</div>

On mac I use gifox. Windows folks use ScreenToGif I think

[Next page](https://forum.makecode.com/t/minimap-extension-beta/1709.md?page=2)
