Next screen button visible at end of game

I want to make a button thats only visible if the game is finished, and then it shoud go to next screen. But it doesnt do that, it resets the game and opens screens 1 again. what am i doing wrong?
prtsc5


prtsc3
prtsc2
prscr1

Hello scavenger_Hunt, welcome to the community!

From the code we can see, you never actually open another Screen.........

Invisible buttons are generally not a good idea - you can keep it on Screen, disabled until required.

Note, procedure "nextGame" calls other procedures in succession - because of App Inventor's paradigm, you probably won't get away with that. Instead, 'next' should call 'createDefaultImageList' and 'createDefaultImageList' should call 'createButtonList'.

thank you, a button that is disabeld untill game is finished will also do the job. how do i do that?

A button has a visible and as well an enabled property. Just set it to true or false as you like

Taifun

Thank you so much for helping me. and it sounds easy but i want it to change from disabled to enobled wenn the game is finished so the player can play the next level. how can i make it change until the game is played?

yes, it is very simple

set it in the designer to enabled = false so it appears disabled when the game starts and when the game is finished set it in the blocks editor to enabled = true
Taifun

i think i sound realy stupid but how does the app now wenn the game is finished?
i already tryed to do that but i cant seem to get it right.

Reframing the question might help you. Your question can also be written as "how does my code decide that the game has finished?"

Unfortunately we do not know, how your game works... you might want to elaborate...

For example a game could end

  • if the good guy found the treasure, or
  • if the dragon killed the good guy, etc

It just depends on the game

Taifun

2 Likes

thank you all for helping me, it is solved.
i was thinking to difficult:)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.