# A Problem with my game, I don't know what it could be!

**URL:** https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393
**Category:** Help
**Created:** [December 17, 2021, 9:43pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393 "2021-12-17T21:43:54Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)
#### Post date: [December 17, 2021, 9:43pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/1 "2021-12-17T21:43:54Z")

</div>

When the code runs in my game, at some point during a fade to black, the game freezes. It doesn’t even have an error crash. The game just keeps running as a black screen. None of the buttons work, not even the menu button, and the same thing happens every time I reset the game.

> **[Tie Dye Run Title Screen](https://arcade.makecode.com/57037-57517-43794-07206)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Can anyone help?

---

<div class="post-metadata">

### Author: ![LaxJack](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@LaxJack](https://forum.makecode.com/u/LaxJack)
#### Post date: [December 17, 2021, 9:53pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/2 "2021-12-17T21:53:09Z")

</div>

I think you should try doing the debug mode because that can indicate if something is wrong with the code. I hope this works also nice artwork.

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [December 20, 2021, 6:00pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/3 "2021-12-20T18:00:17Z")

</div>

I fixed it by removing the controls function and putting the contents of the function into the “while true” block. After that I changed the “while true” block to an “if true then” block and put the contents of the “while true” block into the “if true then” block. Here’s the game:

> **[Tie Dye Run Title Screen](https://arcade.makecode.com/43675-96693-49908-18069)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![demoCrash](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/democrash/32/3528_2.png) [@demoCrash](https://forum.makecode.com/u/demoCrash)
#### Post date: [December 20, 2021, 6:03pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/4 "2021-12-20T18:03:16Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/14eca688d72f5ad63d8fe76578947f57899fd58b.png)  
It is not appropriate to use a while loop in this place. The CPU will always execute the statements of this loop and has no free time to do other things.

---

<div class="post-metadata">

### Author: ![Primal\_Nexus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/primal_nexus/32/3540_2.png) [@Primal\_Nexus](https://forum.makecode.com/u/Primal_Nexus)
#### Post date: [December 20, 2021, 6:03pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/5 "2021-12-20T18:03:27Z")

</div>

I don’t see anything wrong with this code, the fade works perfectly into the save slot(s) scree.

---

<div class="post-metadata">

### Author: ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)
#### Post date: [December 20, 2021, 6:04pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/6 "2021-12-20T18:04:18Z")

</div>

Maybe you should try to reset the palette after the screen fades to black?

---

<div class="post-metadata">

### Author: ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)
#### Post date: [December 20, 2021, 7:42pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/7 "2021-12-20T19:42:54Z")

</div>

Oh, that’s what was happening. Thank you!

---

<div class="post-metadata">

### Author: ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)
#### Post date: [December 20, 2021, 7:50pm UTC](https://forum.makecode.com/t/a-problem-with-my-game-i-dont-know-what-it-could-be/11393/8 "2021-12-20T19:50:59Z")

</div>

thank you too @Kiwiphoenix364
