Programming for kids: [lesson #4] let's keep records
let's spend more time developing our Sprite jumping Game
Coding With Scratch
Counting successful sprite jumps
In a previous lesson, we added a Crab sprite and scripted the cat to jump over it.
Today we will be adding some features to this game of ours, we want to add a counter to keep records of the number of successful jumps we have made.
What could be needed
- A place to display the results
- Something that will do the counting
- A way of telling when the jump is successful
- Clean the count once game is over
- And thing that will come up
You may not be able to anticipate everything you will need before starting a particular module like the one we are about to do. Along the line, we may see some things we missed and will have to fit it in.
Lesson 1 | load the scratch environment, following the instructions in lesson 1. That will require going to the address bar and entering https://scratch.mit.edu |
---|---|
Lesson 2 | In lesson 2 we created the cat sprite, scripted that cat and made it jump once tapped on the screen. |
Lesson 3 | Lesson 3 involved the creation of a Crab sprite. We scripted it to move and the cat is expected to jump over the crab. |
let's start from where we stopped
• Move to the menu bar
• Go over to the file option
• Select Load from your Computer
You will be asked to select an action which I will select the folder
This will open to a location where you can select the file you previously saved or copied to your phone. The file name is likely to be called Scratch Project x-y-z.
Select it and we are right back where we stopped.
With a little modification we now have this as the script for the cat sprite and the other for the Crab sprite.
Create a Score Sprite
We will need a sprite that will help with the counting once it's being touched.
Based on this setup, once the Crab gets to the bread it means the Cat's jump was successful and we can count that.
Creating a variable
Click on the variable category
Select "make a variable"
Select the "for all sprites" radio button and ok
This will create a Sprite and place it on top of the screen where the scores will be displayed.
Assuming the score sprite is active
Drag in the set variable block
Make sure it reads, set score to zero
We now go over to the Crab sprite, and add a script that says... If the crab is touching the bread
Then the score block should change by one
And wait a bit.
Now if we should put them all together
The score here shows eleven successful jumps over the crab.
But I remember making 15 successful jumps which was my highest score. We could create a Sprite to keep track of high score on this game.
Lesson 1 | Introduction |
Lesson 2 | Getting Started |
Lesson 3 | Animating Your Sprite |
Lesson 4 | keeping a record |
Lesson 5 | The next level |
After making 20 successful jumps, we should move to another level to make the game interesting and avoid boredom.
Evaluation
[1.] Can we avoid using the bread sprite? If yes, how.
[2.] What is the purpose of the set score to 0 block
[3.] What is the function of the change score by 1 block
[4.] What is the function of the wait .25 second
Rules
- All participants must be verified kids
- This homework is for the kids and Not the parents
- The homework post should be = or > 300 .
- Post in the steemkids Community.
- Make @steemkidss a beneficiary with at least 10%.
- You must belong to club50 club75 or club100
- Drop your entry link at the comment section.
- All participants who perform well will be rewarded.
- Use the tags learnwithsteem and steemexclusive yourcountry, assignment and your club status as part of your hashtag.
Cc
@steemkidss
@ngoenyi
@benton3
@goodybest
@eliany
@patjewell
Written by @manuelhooks for steemkids
fintech steemexclusive nigeria club100 steem scratch technology
My friend pls add the #learnwithsteem tag to you post so that I can publish it.
https://steemit.com/learnwithsteem/@patjewell/zhol7-learn-with-steem-top-post-for-01st-august-2022
Thank you for the correction, the tags have been updated...
Thank you! I’ve added your post 😊
Note: You must enter the tag #fintech among the first 4 tags for your post to be reviewed.
Congratulations, your post has been supported by @steem4nigeria. This is the official community account of Nigerians on Steemit. You can reach us here on our community account.
Discord Facebook Twitter
Hello, I will like to invite you to the ongoing Power up promotion and stand a chance of winning 2000SP in delegation. This is a great opportunity you wouldn't want to miss to build your Steem power and win delegation rewards. Join the contest using the link below.
Contest Alert (#growwithsteem-naija) Let's Grow Bigger Naija (Powerup/Promotion) by @ngoenyi. Win Monthly Delegation