# Messed up my game? pls help

**URL:** <https://forum.makecode.com/t/messed-up-my-game-pls-help/46407>\
**Category:** Help\
**Tags:** game\
**Created:** [October 10, 2026, 8:49pm UTC](https://forum.makecode.com/t/messed-up-my-game-pls-help/46407 "2026-10-10T20:49:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![2cool4u](https://avatars.discourse-cdn.com/v4/letter/2/ea5d25/32.png) [@2cool4u](https://forum.makecode.com/u/2cool4u)\
**Post date:** [October 10, 2026, 8:49pm UTC](https://forum.makecode.com/t/messed-up-my-game-pls-help/46407/1 "2026-10-10T20:49:57Z")

</div>

When my game attempts to load (clicking b when cursor is over play button) it fails MISERABLY. I have no idea why, but some codes run when they shouldn’t and therefore just recieve ‘null’ making the game unplayable! Please help!!! 🥲

> **[game thats bugged](https://arcade.makecode.com/S26981-14023-81453-51481)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![6134](https://avatars.discourse-cdn.com/v4/letter/6/c6cbf5/32.png) [@6134](https://forum.makecode.com/u/6134)\
**Post date:** [October 11, 2026, 7:41pm UTC](https://forum.makecode.com/t/messed-up-my-game-pls-help/46407/2 "2026-10-11T19:41:15Z")

</div>

Try using the Browser Events extension.

this is the code with the extension added.

> **[game thats bugged](https://arcade.makecode.com/20431-61067-58811-81576)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![2cool4u](https://avatars.discourse-cdn.com/v4/letter/2/ea5d25/32.png) [@2cool4u](https://forum.makecode.com/u/2cool4u)\
**Post date:** [October 11, 2026, 9:59pm UTC](https://forum.makecode.com/t/messed-up-my-game-pls-help/46407/3 "2026-10-11T21:59:58Z")

</div>

its still broken on my side 😢

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [October 12, 2026, 12:06am UTC](https://forum.makecode.com/t/messed-up-my-game-pls-help/46407/4 "2026-10-12T00:06:18Z")

</div>

![Screenshot 2026-10-11 at 4.52.24 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/a/6ae5956b760f01efb872fb790f5e920552460842.png)  
If you run the project in debug mode (the little beetle icon under the simulator) you can see that the error happens here. Basically what this means is that this code is trying to do something with this health bar, but the health bar doesn’t exist. This can be fixed by not running that code until the player reaches level 2, where that status bar is created. You could also check if the status bar exists before running the code, like this:  
 ![Screenshot 2026-10-11 at 6.58.40 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/2/d262ee932c5ac1b9008465e5a4fc3f24de024e90.png)  
This does not fix the issue because there are a bunch of places that try to use objects before they are created in this project. You’ll have to fix all of those for it to work properly.
