How to create a high score in Scratch using cloud variables

  Рет қаралды 6,725

Jared O'Leary //Multiplicity

Жыл бұрын

🐱 More in my Scratch playlists in the home tab jaredoleary.com/scratch
🎧 Computer science education podcast jaredoleary.com/csk8
🖥️ PC specs and gear I use jaredoleary.com/gear
🎮 Gaming playlists jaredoleary.com/game
🥁 Drumming playlists jaredoleary.com/drum
📅 Stream schedule jaredoleary.com/schedule
👕 Merch jaredoleary.com/merch
👪 Socials (in the menu) jaredoleary.com
🐱 Scratch project scratch.mit.edu/projects/870616758/
🐱 How to become a Scratcher en.scratch-wiki.info/wiki/Scratcher
━━━━━━━━━━━━━
Discover how to save and display high scores in your Scratch game!
Did you know that you could save scores in Scratch to make players compete for the highest score in your game? For example, you can create a high score for the longest time someone was able to play a simple jumping game where you have to jump at least once per second, or the game stops.
To save a score across accounts, you'll need to use a special variable called a cloud variable. First, you need to accept to become a Scratcher and sign into Scratch with that account. To learn more about how to become a Scratcher, see the link in the description. Then, make a variable and check the cloud variable box before you press OK. You'll know it's worked if you have a variable that has a cloud next to it.
Next, use the high score variable to set the highest score in your game. Instead of setting the high score to zero when you start your game, add an if block when the game ends to check if anyone playing the game has a timer that is higher than the high score variable. If they do, set the high score variable to the timer variable and stop the game.
Don't forget to show the high score variable when the game ends and hide it when it starts. Now, whenever someone plays the game, it will update the longest time variable whenever someone sets a new high score, but it won't change the variable if they don't beat the high score.
Check out the links above for more free Scratch videos, projects, lessons, tips, etc. If you'd like to learn how to teach computer science education with your students, check out the #CSK8 Podcast in the link above to explore research, experiences, and perspectives on computer science education through interviews with computer science educators, scholars, and administrators, as well as episodes that summarize and unpack implications of research for classroom teachers who are interested in learning more about practical applications of research in their classroom.
#scratch #JaredOLeary
━━━━━━━━━━━━━
00:00 Game demonstration
00:13 You need a cloud variable
00:18 How to get cloud variables
00:26 Make a cloud variable
00:34 We don't need to initialize the variable when the game starts
00:47 Checking to see if someone beat the high score
00:55 Setting the new high score
01:00 Showing and hiding the high score
01:06 Demo
01:14 How to find the code for this project (and even more Scratch tips)

Пікірлер: 6
@JaredOLeary
@JaredOLeary Жыл бұрын
🐱 More Scratch content in my playlists: jaredoleary.com/scratch 🎧 Computer science education podcast: jaredoleary.com/csk8 🎮 Gaming playlists jaredoleary.com/game 🥁 Drumming playlists jaredoleary.com/drum 📅 Stream schedule jaredoleary.com/schedule
@ilov.my.profile
@ilov.my.profile 10 ай бұрын
this video is soo underrated like more people should be seeing this !
@JaredOLeary
@JaredOLeary 10 ай бұрын
Thank you for the kind words! Many more in my Scratch playlists (and many more to come)
@ilov.my.profile
@ilov.my.profile 10 ай бұрын
yw and keep up the good work !@@JaredOLeary
@ilov.my.profile
@ilov.my.profile 10 ай бұрын
tysm this helped
@JaredOLeary
@JaredOLeary 10 ай бұрын
You're very welcome! Many more in my Scratch playlists.