Discuss Scratch

Mr_Woomy
Scratcher
500+ posts

How do i add a high score feature?

Hi
royalmichaelg
Scratcher
21 posts

How do i add a high score feature?

when green flag clicked
forever
if <(score) > (☁ score)> then
set [☁ score v] to (score)
end
end
Mr_Woomy
Scratcher
500+ posts

How do i add a high score feature?

royalmichaelg wrote:

when green flag clicked
forever
if <(score) > (☁ score)> then
set [☁ score v] to (score)
end
end
How do i make it when the high score IS set it keeps the person who got the last ones name?
cool_coder63
Scratcher
20 posts

How do i add a high score feature?

Mr_Woomy wrote:

royalmichaelg wrote:

when green flag clicked
forever
if <(score) > (☁ score)> then
set [☁ score v] to (score)
end
end
How do i make it when the high score IS set it keeps the person who got the last ones name?
that would need a decoder because cloud variables don't hold text only numbers (edit: nvm I read it wrong and I don't understand)

Last edited by cool_coder63 (Aug. 19, 2021 00:14:42)

Thingied
Scratcher
1000+ posts

How do i add a high score feature?

Mr_Woomy wrote:

How do i make it when the high score IS set it keeps the person who got the last ones name?
You'll have to encode it to a cloud variable and decode it when you want to show it.
tueminh2013
Scratcher
17 posts

How do i add a high score feature?

Mr_Woomy wrote:

royalmichaelg wrote:

when green flag clicked
forever
if <(score) > (☁high score)> then
set [☁ high score v] to (score)
end
end
How do i make it when the high score IS set it keeps the person who got the last ones name?
Script:
Add code
set [☁Username record v] to (username)
on if

Last edited by tueminh2013 (Aug. 19, 2021 07:52:41)

deck26
Scratcher
1000+ posts

How do i add a high score feature?

Don't set a cloud variable in a forever loop if that might mean it updating more than once per 0.1 seconds.

To store a username and high score you need to encode the username and store that to the cloud as well. You can easily combine a score and a username in a singel cloud variable.

The wiki page on Global High Scores is a good reference.
vineet_wibyte
Scratcher
28 posts

How do i add a high score feature?

As mentioned above, this is done with a cloud variable. I agree, however, that is not a great idea to keep the update of a cloud variable inside forever, unless absolutely necessary. Better is to use a broadcast towards the end of the game and update once. Please take a look at https://youtu.be/YCkXqyIpFp4 and the links from the description to learn more about cloud variables and their usage for high score etc, Take care, cheers!
swordslasher_1290
Scratcher
48 posts

How do i add a high score feature?

when I receive [next level v]
set [highscore v] to [score]
swordslasher_1290
Scratcher
48 posts

How do i add a high score feature?

mrcreatorluigi
Scratcher
1000+ posts

How do i add a high score feature?

tueminh2013 wrote:

Script:
Add code
set [☁Username record v] to (username)
on if
That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
orangetheory
Scratcher
500+ posts

How do i add a high score feature?

swordslasher_1290 wrote:

when I receive [next level v]
set [highscore v] to [score]

swordslasher_1290 wrote:

Please don't necropost or spam

tueminh2013 wrote:

Mr_Woomy wrote:

royalmichaelg wrote:

when green flag clicked
forever
if <(score) > (☁high score)> then
set [☁ high score v] to (score)
end
end
How do i make it when the high score IS set it keeps the person who got the last ones name?
Script:
Add code
set [☁Username record v] to (username)
on if
Wouldn't work as cloud variables can't contain letters or symbols to prevent online chatting and other safety reasons
Earthbright
Scratcher
97 posts

How do i add a high score feature?

How can I make a battle Royale game with scrolling maps that can be selected at the start?
Mr_Woomy
Scratcher
500+ posts

How do i add a high score feature?

Earthbright wrote:

How can I make a battle Royale game with scrolling maps that can be selected at the start?
Bro why are you here to ask that?

This is a post for something different
yitenggenius
Scratcher
37 posts

How do i add a high score feature?

tueminh2013 wrote:

Mr_Woomy wrote:

royalmichaelg wrote:

when green flag clicked
forever
if <(score) > (☁high score)> then
set [☁ high score v] to (score)
end
end
How do i make it when the high score IS set it keeps the person who got the last ones name?
Script:
Add code
set [☁Username record v] to (username)
on if
on scratch you cant use letters in cloud variables
NetherRobot01
Scratcher
14 posts

How do i add a high score feature?

mrcreatorluigi wrote:

tueminh2013 wrote:

Script:
Add code
set [☁Username record v] to (username)
on if
That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
You can, it's just going into crazy topics such as encrypting and decrypting.
NetherRobot01
Scratcher
14 posts

How do i add a high score feature?

NetherRobot01 wrote:

mrcreatorluigi wrote:

tueminh2013 wrote:

Script:
Add code
set [☁Username record v] to (username)
on if
That won’t work because cloud variables can only hold numbers (unless your username has numbers only)
You can, it's just going into crazy topics such as encrypting and decrypting.
Or something even more advanced such as shifting.
JaxTheWarrior83
Scratcher
20 posts

How do i add a high score feature?

when green flag clicked
forever
if <(foo) > (☁ score)> then
set [(☁ score) v] to [score]
set [HScoreName v] to (username)
end
end

Last edited by JaxTheWarrior83 (Aug. 30, 2021 15:09:40)

Thingied
Scratcher
1000+ posts

How do i add a high score feature?

JaxTheWarrior83 wrote:

set [HScoreName v] to (username)

mrcreatorluigi wrote:

That won’t work because cloud variables can only hold numbers (unless your username has numbers only)

Powered by DjangoBB