2014년 12월 29일 월요일

App Crashes With Start Value

So I'm creating a game. So in my app every time someone clicks a button their score increases by +10, but when they get three wrong they go to another screen (Fail Screen) which takes the start value of their current score and their best score when the "fail screen" opens, and displays it (Capture 3 - Image Name). Then the person click the play again button and then opens the instructions page with the best score as the start value (Capture 1 - Image Name). Then on Instructions screen the best score start value is displayed in a hidden label, and then when continue is pressed on the "Instructions" screen the best score {displayed in a hidden label} (Capture 2 - Image Name)  is taken to the level 1 screen and displayed it on the level 1 screen (Capture - Image Name) 

The problem is after the person has played one round and fails they are taken to the "fail" screen and then they click the "play again" button and go to the "Instructions" screen but on the "Instructions" screen when they press the continue button to go the level 1 screen the game crashes. Says the game has stopped. 


Sorry i know it is long and confusing but i really need help on this if you need more info or pictures let me know. 







it seems to be, you are never using the close screen blocks
see here how to switch screens correctly

The recommended method of switching screens in App Inventor




is there a way to carry a "start value" when the screen is closed? Like when we say open screen name ____ with start value ________ ??? 




If you say open with start value, the value is passed to the opened screen.  If you have to get the value back at the original screen, you can use the close screen with result block and trap that back on the original screen.

You can also, almost more easily, transfer this sort of data from screen to screen using a TinyDB...



댓글 없음:

댓글 쓰기