Programming for kids: [lesson #4] let's keep records

in hive-139765 •  2 months ago  (edited)

photostudio_1659463447994.jpg 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 3Lesson 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

photostudio_1659428973056.png
You will be asked to select an action which I will select the folder

photostudio_1659429681406.png

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.

photostudio_1659429519460.png
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.

photostudio_1659431069507.png

Screenshot_20220802-100125.png

Create a Score Sprite

We will need a sprite that will help with the counting once it's being touched.

photostudio_1659431832218.png
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

photostudio_1659441828568.png

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
photostudio_1659444300439.png

We now go over to the Crab sprite, and add a script that says... If the crab is touching the bread

photostudio_1659446642109.png

Then the score block should change by one
photostudio_1659447882782.png
And wait a bit.

Now if we should put them all together

photostudio_1659453327905.png

The score here shows eleven successful jumps over the crab.
photostudio_1659511231351.png
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 1Introduction
Lesson 2Getting Started
Lesson 3Animating Your Sprite
Lesson 4keeping a record
Lesson 5The 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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the correction, the tags have been updated...

Thank you! I’ve added your post 😊

Your post has been successfully curated by our team via @ozenozge at 40%. Thank you for your committed efforts, we invite you to do more and keep posting high quality posts for a chance to win valuable upvotes from our team of curators and probable selection for an additional upvote later this week in the Top Seven.

received_388032689541375-1.jpeg

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.

Manual Curator : @Reminiscence01

Subscribe and Join Steem4Nigeria Telegram
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

Loading...