Quick question about highscore... Just WONDERING
JodyMitoma
Member Posts: 307
PLEASE DELETE THREAD. Made a much more detailed one. Thank you.
...
If I want to make sure that my game displays each level's HighScore from within the popup window that displays before you begin the match (popup window displays the level number, your previous highscore, and a "Play" button)... Do I have to make a separate "Score" AND "Highscore" attribute for every single level?!?! O.O
I have 27 levels, and well, I find this may become a burden quite quickly.
This discussion has been closed.
Comments
You might want to put that in a table:
https://help.gamesalad.com/hc/en-us/articles/202044496-2-6-Tables
https://help.gamesalad.com/hc/en-us/articles/202455968-2-7-Writable-Tables
It's like a spreadsheet, so you can easily add rows for each level.
Funny you say this. I'm actually in the processes of doing this now... Or at least, trying to...
I've done everything that should make it work perfectly, but for some strange reason, it just won't update the table value to the new high score.. It's stuck at zero, and it's rather annoying.
If I change the table value manual, it displays the new number, but that defeats the purpose. Just checking if the table is working, which it is.
I have no idea what is wrong here.
I have it set as follows:
Timer -- every 0 seconds Run to Completion
--Rule - if game.Score > tableCellValue(game.TABLEHighScore, game.LevelNumber, 1)
DO - Change Table Value
Table: TABLEHighScore
Row: game.LevelNumber
Column: 1
Value: game.Score
Save Table: TABLEHighScore
Then I have a "Display Text" with tableCellValue(game.TABLEHighScore, game.LevelNumber, 1) to display the high score, which it does, but the table's cell value just won't update!
Is there something wrong here? It seems rather common sense to me, but just won't work.
(game.Score updates score in game perfectly)
Thank you so much for any assistance here.
Also keep in mind, that I have a change attribute set for "LevelNumber" that will change depending on what level you are on, which in this case is Level 1, which in turn makes the row set to "Row 1".
I'm not sure. I know that write operations are slower than changing a value in memory, so it could be that by writing every 0 seconds, you're getting problems. I'd start by trying to only save the highscore when the level is finished, and not using the timer every 0 seconds. If that works you could try making it more frequent.
Appreciate your attempt to help, but that didn't work either.
I'd have it so that the highscore would update only when the player dies, but first I'd like to get it working at all.
Just to test, try making a button that uses changeTableValue when pressed, and make the cell something besides the default. then save the table and see if it persists.