# Buggy game freezes

**URL:** https://forum.makecode.com/t/buggy-game-freezes/15170
**Category:** Arcade
**Created:** [August 31, 2022, 6:05pm UTC](https://forum.makecode.com/t/buggy-game-freezes/15170 "2022-08-31T18:05:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![breakingboredomloops](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@breakingboredomloops](https://forum.makecode.com/u/breakingboredomloops)
#### Post date: [August 31, 2022, 6:05pm UTC](https://forum.makecode.com/t/buggy-game-freezes/15170/1 "2022-08-31T18:05:18Z")

</div>

This game has a menu for choosing level difficulty etc.  
After making the selection the game freezes and I do not understand the cause of the error.  
Could anyone please help?  
Link: [https://makecode.com/\_PycTtd3UdeqE](https://makecode.com/_PycTtd3UdeqE)

---

<div class="post-metadata">

### Author: ![isoffline](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/isoffline/32/8791_2.png) [@isoffline](https://forum.makecode.com/u/isoffline)
#### Post date: [August 31, 2022, 8:17pm UTC](https://forum.makecode.com/t/buggy-game-freezes/15170/2 "2022-08-31T20:17:54Z")

</div>

maybe bc when you click any button it has not apear yet bc of the control menu maybe the simulator is confused bc there is a variable that will hapen

---

<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: [August 31, 2022, 9:53pm UTC](https://forum.makecode.com/t/buggy-game-freezes/15170/3 "2022-08-31T21:53:19Z")

</div>

For these sorts of issues, the debug mode is usually good to see where the error is occurring and why:

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

and you play the game in debug mode and it crashes, it will stop on the error and highlight the block that ‘broke’ when possible:

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

It looks like when you call `play level` for the first time when PlayLevel == 0, back\_menu hasn’t been created yet – I saw it being made in the later levels but just not there it looks like:)

---

<div class="post-metadata">

### Author: ![breakingboredomloops](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@breakingboredomloops](https://forum.makecode.com/u/breakingboredomloops)
#### Post date: [September 6, 2022, 4:20pm UTC](https://forum.makecode.com/t/buggy-game-freezes/15170/4 "2022-09-06T16:20:13Z")

</div>

Thank you for your help.  
The game is more functional now.  
He is the updated version. Would appreciate any feedback.

> **[Jetpack Joyride Project - STEM - V4](https://arcade.makecode.com/65748-44574-88482-46660)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.
