where my problems start, the problems are:
- I have a retry and score label which displays the score and the number of retries left and when the screen first initializes this is set to 10 and 100 respectively but if they get it wrong then it is supposed to take away 1 and 10 from them and whilst it does that it still has the previous value in the label so instead of being 90 for example it is 10090 !!!
- My other problem is that I can't call a global, NOT local as some may point out, variable on another screen when I try to do so the drop down list is blank and a tick is on the left and this means that for other screens such as the Game Over screen where I am supposed to display the score I can't - a major problem.
Global variables are only global for the screen they're on... They don't pass to other screens. If you need persistent data, use a TinyDB on both screens.
If you get your computation for the tries into a variable, and then set the label.text to that variable, it'll only show the contents of the variable.
If you get your computation for the tries into a variable, and then set the label.text to that variable, it'll only show the contents of the variable.
댓글 없음:
댓글 쓰기