I have a question about saving scores?

mexicanchango

  • Posts: 17
I've managed to have my high score "Draw", but it's always at zero.
Here is what I have, can anybody help ? I would be extremely grateful
sorry I didn't make the pictures smaller.

Max Finch

  • *
  • Posts: 2174
Your problem is in your first screen shot. You're setting your score to 0 and then saving the game.

Place the set highscore block inside the save game block

Place the If statement inside the block where the setting score to 0 block used to be.

Max Finch

  • *
  • Posts: 2174
This might be what you'll want.

mexicanchango

  • Posts: 17
It still didn't work :(
Looks like I'm going to have to solve this with persistence. Thank you for your help though.

mexicanchango

  • Posts: 17
I think it might have something to do with my score not being saved.

Max Finch

  • *
  • Posts: 2174
Put the "set time as highscore block" in an always event.

Remove the set" highscore to 0 block"

mexicanchango

  • Posts: 17
Na, it still didn't work. I'm going to start all over again. You got any advice or new method of how  I should go at it.

Max Finch

  • *
  • Posts: 2174
This game seems to me like it's a game where you try to last as long as you can right?


If so this is what I would do:




In your first scene put the following:





In your gameover behavior do this:





In your gameplay scene put this:





Of course make sure you still keep your score drawn where you'd like. What the following does is at first it loads any save data when you start your game.


Next when you enter your gameplay scene if your time hasn't already been reset to 0 it will set your time to 0.


When your game ends if your time is greater than your high score it sets your highscore to time. You don't want to reset your highscore to 0 but keep your time to it's value that's silly.


Let me know if the following works. Tweak how you'd like! But keep the gist of it.