HELP PLEASE! With a coding project

I am helping students with a coding project for a “Passion Project” they are working on. They are asking a user a bunch of questions. They way they answer each question will lead to a new screen with a new question.

For some reason when I add on the screen to choose hot cocoa or hot tea the screen where the user is supposed to choose between a drink or food disappears, it gets skipped right over?

I have looked at this forever! I know I am missing something simple, but I can’t find it.


Your Issue pertains to sprites being able to be clickable regardless if they are visible or not meaning you can do literally everything out of order, not to mention all of your choices are layered over each other meaning that you can either back track or forward all the way to the last screen, to keep track you should have a screen counter of sorts but to be quite frank with you i don’t really want to refactor this currently maybe if you understand what i mean you should be able to fix this

Trying to understand, are you saying that if I make a sprite invisible that I should then relocate it?

Are you suggesting that maybe I could create a variable that keeps track of click counts?

Thank you!

Well you can do that but since I’ve had a longer time to think about it i think this would be the more optimal approach to your problem

if (mouseIsOver(sweet) && mouseWentUp("leftButton")) {
// you can also use mouseWentDown if you'd like it to be as soon as you click
    SweetSav = false;
    pickSweet = true;

it’s just one more condition to add on to your statement since mousePressedOver constantly checks for the mouse being pressed the issue you had described has made sense but with this method you shouldn’t have to refactor your whole codebase but it seems you may have found a better justifiable solution but anyways best of luck!