# Help. No seriously. My game is broken

**URL:** <https://forum.makecode.com/t/help-no-seriously-my-game-is-broken/14355>\
**Category:** Help\
**Created:** [July 6, 2022, 11:24pm UTC](https://forum.makecode.com/t/help-no-seriously-my-game-is-broken/14355 "2022-07-06T23:24:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jackal/32/19506_2.png) [@jackal](https://forum.makecode.com/u/jackal)\
**Post date:** [July 6, 2022, 11:24pm UTC](https://forum.makecode.com/t/help-no-seriously-my-game-is-broken/14355/1 "2022-07-06T23:24:02Z")

</div>

> **[Investible! (NOT THE FULL GAME.)](https://arcade.makecode.com/61251-86470-26539-97033)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Okay, two questions. Anyone is welcome to help.  
1: Why doesn’t the number of money show up after the game reloads? It is being saved.  
2: Why does my game break when the main variable (delivery\_start?) is set to true, and the status bar is filling?

If anyone has an answer to it, you are welcome to weld it into the code. - CyberPulse

---

<div class="post-metadata">

**Author:** ![DahbixLP](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dahbixlp/32/4760_2.png) [@DahbixLP](https://forum.makecode.com/u/DahbixLP)\
**Post date:** [July 7, 2022, 5:14pm UTC](https://forum.makecode.com/t/help-no-seriously-my-game-is-broken/14355/2 "2022-07-07T17:14:26Z")

</div>

I fixed the money thing with 1 easy thing. Basically you set the money on the sprite but not the saved money on the money variable.  
 ![Screenshot_2022-07-07-07-11-23-485_com.android.chrome](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/730fdd2d12ffa45273d0f08ecb5220bc8cb8d51b.jpeg)  
I have not checked the second problem but the game didnt break for me in the 3 minutes

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [July 7, 2022, 5:15pm UTC](https://forum.makecode.com/t/help-no-seriously-my-game-is-broken/14355/3 "2022-07-07T17:15:21Z")

</div>

Hi, @jackal

For #1, in your `game` function, you test for whether the setting has been saved, but you never load it back into the `money` variable. Change the `else` clause to this:

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

For #2, I have a feeling I know what is going on, although I couldn’t test it for sure. You have this:

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

This is an example of an _infinite loop_. Once you enter the `while` loop, you have no way of getting out, and your game will appear to be frozen. What I think you want is something like this:

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

Your game still might freeze until the status bar fills up, though, because `pause` is what’s called a _blocking function_. A **blocking function** stops your code until it completes. If that’s the case, then you can do this instead:

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

Good luck! Let us know if you need additional help.

---

<div class="post-metadata">

**Author:** ![jackal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jackal/32/19506_2.png) [@jackal](https://forum.makecode.com/u/jackal)\
**Post date:** [July 7, 2022, 11:40pm UTC](https://forum.makecode.com/t/help-no-seriously-my-game-is-broken/14355/4 "2022-07-07T23:40:14Z")

</div>

Thanks for the help man! You too @DahbixLP !
