# Block Menu acting up

**URL:** <https://forum.makecode.com/t/block-menu-acting-up/4817>\
**Category:** Help\
**Created:** [December 5, 2020, 10:12pm UTC](https://forum.makecode.com/t/block-menu-acting-up/4817 "2020-12-05T22:12:38Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [December 5, 2020, 10:12pm UTC](https://forum.makecode.com/t/block-menu-acting-up/4817/1 "2020-12-05T22:12:38Z")

</div>

> **[War Subs](https://arcade.makecode.com/30101-26331-40589-27698)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Why is this not working? Thanks!

---

<div class="post-metadata">

**Author:** ![andrew-ski](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/andrew-ski/32/1774_2.png) [@andrew-ski](https://forum.makecode.com/u/andrew-ski)\
**Post date:** [December 5, 2020, 11:18pm UTC](https://forum.makecode.com/t/block-menu-acting-up/4817/2 "2020-12-05T23:18:03Z")

</div>

I think the reset game block at the bottom of the on menu option selected block is causing problems. I pulled that out and the game runs much better, from what I can tell. Maybe you can explain exactly what is going wrong, if that’s not the issue.

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

P.S… Jaw dropping art.

---

<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:** [December 6, 2020, 1:51am UTC](https://forum.makecode.com/t/block-menu-acting-up/4817/3 "2020-12-06T01:51:45Z")

</div>

The reset game block was used to update the images after selling a part and removing it from the “OwnedParts” array (press B to open the menu, then sell part). I removed it and manually called the functions “UpdateStats”, “UpdateSubDisplay”, and “UpdateTextDisplay”. It works fine for a bit, then goes weird again. To be clear, It suddenly says, “are you sure you want to restart?”, which only is supposed to happen when you ask to restart.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [December 6, 2020, 7:28pm UTC](https://forum.makecode.com/t/block-menu-acting-up/4817/4 "2020-12-06T19:28:37Z")

</div>

I am not completely sure how the BlockMenu extension works, but this is what I noticed. When I started debugging the game, I could open the menu with B, choose various options and eventually close the menu with “Cancel”. However, when I was moving the submarine around, it then started calling the ‘on menu option selected’ block function (I put a breakpoint at the first if statement). In the BlockMenu I noticed there is a ‘set controls enabled’ method. When I added that to the ‘B’ event, I had set that to false, but then I could not move the menu options. I set that method to ‘true’ after opening the menu, and to ‘false’ again when selecting ‘Cancel’.

The menu no longer appears while playing, so I think this may be the fix. Otherwise you could check with @richard, as he made the extension.

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

BTW: the options when asking to restart are barely visible. Otherwise, again, you have made a really good game and I like how the submarines shoot each other. Being able to select different submarines and parts is quite unique.

---

<div class="post-metadata">

**Author:** ![andrew-ski](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/andrew-ski/32/1774_2.png) [@andrew-ski](https://forum.makecode.com/u/andrew-ski)\
**Post date:** [December 6, 2020, 7:29pm UTC](https://forum.makecode.com/t/block-menu-acting-up/4817/5 "2020-12-06T19:29:35Z")

</div>

It may be how it’s nested in the if statement? I had a hard time with the menu blocks sequences.

---

<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:** [December 6, 2020, 8:34pm UTC](https://forum.makecode.com/t/block-menu-acting-up/4817/6 "2020-12-06T20:34:09Z")

</div>

Thanks! This really helps! I forgot to add that block.

> [@cosmoscowboy](#):
>
> BTW: the options when asking to restart are barely visible.

Yes, I plan to change the palette to fix that.
