Help. No seriously. My game is broken

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

2 Likes

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
I have not checked the second problem but the game didnt break for me in the 3 minutes

1 Like

Hi, @CyberPulse

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

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

image

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

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:

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

1 Like

Thanks for the help man! You too @DahbixLP !

1 Like