Discuss Scratch

bookworm7214
Scratcher
100+ posts

How can I save stuff so when stop is pressed it is saved onto the next re-run??

I'd like to be able to save high scores, etc, for the next re-run of my project. Is this possible and how would I go about doing it??

Sorry, not a very catchy title.

Original text:
“Scratch is an educational programming language aimed at children. It was developed in MIT, America.”
..35 translations later, Bing gives us:
“Australia Institute created the children's education, it doesn't matter.”
The above translation is courtesy of Akuna Bad Translator.
Please welcome my sister, gingerninja97, to the Scratch website!
< You (or more correctly, lesser known Scratchers) won't be unknown anymore.
drmcw
Scratcher
1000+ posts

How can I save stuff so when stop is pressed it is saved onto the next re-run??

That's what cloud variables are for. If you create a variable called high score say and tick the cloud variable check box then you can have in your code;
if <(score) > (high score)> then
set [high score v] to (score)
end
as high score is a cloud variable it will be saved to the scratch servers and be re-loaded next time.

Last edited by drmcw (Oct. 22, 2013 17:36:48)


10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
cookiesandmore
Scratcher
66 posts

How can I save stuff so when stop is pressed it is saved onto the next re-run??

drmcw wrote:

That's what cloud variables are for. If you create a variable called high score say and tick the cloud variable check box then you can have in your code;
if <(score) > (high score)> then
set [high score v] to (score)
end
as high score is a cloud variable it will be saved to the scratch servers and be re-loaded next time.
that should work

You won't be unknown anymore
also at @cookieartist , @CookieReviews
when green flag clicked
forever

change [ time spent scratching] by (1)
end
andre_rifaut_tests
Scratcher
90 posts

How can I save stuff so when stop is pressed it is saved onto the next re-run??

For best “presentation” you should update the best score at the end of the each game.

For instance in a shooting project, you could add the aforementioned block in a forever block.

But in this case, the best score will be repeatedly updated DURING a (better) game and not at the end of each game.
bookworm7214
Scratcher
100+ posts

How can I save stuff so when stop is pressed it is saved onto the next re-run??

Thanks guys!!!!

Original text:
“Scratch is an educational programming language aimed at children. It was developed in MIT, America.”
..35 translations later, Bing gives us:
“Australia Institute created the children's education, it doesn't matter.”
The above translation is courtesy of Akuna Bad Translator.
Please welcome my sister, gingerninja97, to the Scratch website!
< You (or more correctly, lesser known Scratchers) won't be unknown anymore.

Powered by DjangoBB