Push Me! – Keeping the highest score Let's add a way to keep track of the highest score. To do this add a TinyDB from the Basic palette. This stores a value for a tag or string on the phone and we can get the value for the tag when the app is initialzed. Also add another set of two labels in a horizontal arrangment to show the highest score. Create a new variable to hold the highest score called highestScore. When the Screen1 initializes set the highestScore variable to the value stored in the TinyDB for the tag "pushMeHighest". But, if the highestScore is now empty text store a 0 for the current highest score in the TinyDB and reset it to 0. Also, update the highest score label value. When the time runs out check if the current score is greater than the highest score. If it is then set the hightest score to that value and store it in the database. Also, reset the highest score label.
© Copyright 2026 Paperzz