This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-05 17:14:29

Indiego
New Scratcher
Registered: 2012-02-27
Posts: 61

Highscores

I honestly dont have a clue if this is possible, but is there any way to add highscores to a game?

Offline

 

#2 2012-03-05 17:25:14

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Highscores

Make a list called scores. Assuming you have a variable called score, use scripts like these.

when I receive [Submit Score v]
add (score) to [scores v]

when I receive [Get High Score v]
set [highest v] to [0]
set [i v] to [1]
repeat (length of [scores v])
if <(item (i) of [scores v]) > (highest)>
set [highest v] to (item (i) of [scores v]
end
end
say (join [The high score is: ] (highest))

Last edited by bobbybee (2012-03-05 17:25:54)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-03-05 17:48:00

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Highscores

There is no way to save highscores online and compare user's high scores.

When the page is refreshed, everything is refreshed, including variables.  It is also impossible to store the scores in a database or a file.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2012-03-05 18:23:40

G0D_M0D3
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Highscores

Make a highscore list, make a script to show it, and keep track of commented scores. Then, update the project (make it with the same name, exactly the same name) and change the list.


I made a MC texture pack! Get it at planetminecraft!
http://i.imgur.com/0EG0u.png

Offline

 

Board footer