Programming for kids: [lesson #5] let's create a new level

in Steem Kids & Parents2 years ago (edited)

photostudio_1660323225426.jpg
let's spend more time developing our Sprite jumping Game

Coding With Scratch

Moving to another level

In our previous lesson, we were able to add a counter to keep count of successful jumps. Now we will love to avoid getting bored after repeatedly jumping over the crab by introducing another level in the game.
I would love the new level to come after jumping the crab 15 consecutive times.

The level will have a few changes introduced in to the game. Please try not to loose focus here, the aim is not to create a jumping game but to show you how to script a program with the Scratch environment.

This is a sample of what we are expected to have at the end of this training.

What do we need here

  • We need a second counter that will watch out when the number of successful jumps is 15 in a row so as to initialize the next level.
  • We will need some visible effects showing that the level has changed.
  • Something that will help reset the counter will have to be put in place. Each time we have a consecutive 15 jumps, the level counter will initiate the move into the next level.

Loading our previous work

• load the Scratch application
• Go over to the Scratch menu bar.
• Select the file option.
• Select 'Load from your Computer'.
• When asked to select an action go for the folder.
• Select the appreciate Scratch file.
• This loads our previous work.

Scripting in a new level

The backdrop

  • Go to the backdrop button and create a new backdrop
    I made the tree backdrop for my level 2

  • Create a script for the backdrop
    photostudio_1660387135512.png this runs the plain background at the start of the game.

Creating the Condition
We need a script to
Grab the if then block
photostudio_1660375320829.png

Complete the argument by filling in the hexagon with a condition.

  • We need to Create an argument for the condition*
    • The condition here simple states that:
    when the score = 15

We need a score and we have to make it 15.
So we get to the operator category and pull out this block
photostudio_1660377927252.png

Move over to variables and drag the score variable into the empty space
photostudio_1660377660606.png
This makes the condition read, score = 50 but fifty will be too much. So we will change the value in the second circle from 50 to 15

photostudio_1660378670533.png

Having Changed the value here to correspond with the number of consecutive jumps needed to activate a next level which is 15 in this case.

Our argument for the condition block is created

Now we will place the argument in the if then block.

photostudio_1660380204773.png

Get to the event category and pull out the broadcast block
photostudio_1660381286291.png

Drop the arrow, select new message and type in Level 2

Place the message block into the if loop to complete our condition

photostudio_1660386420378.png

The condition block will be responsible for triggering the switch to level 2

Updating the cat sprite
The condition block is fixed into the script of the cat sprite

photostudio_1660389886200.png

Connecting the dots
We can now go back to the backdrop sprite and add the response to the level 2 message

photostudio_1660388024285.png

The new block says, when I receive the level 2 message, change the backdrop to tree
Which is a visible evidence that we have made a new landmark.

Testing

When I ran the test, I got this once I made my fifteenth jump...

photostudio_1660390124664.png

You could also increase the speed of the crab to make the game.
You could add the number of crabs.
You may also drop in a surprise sprite.

Lesson 1Introduction
Lesson 2Getting Started
Lesson 3Animating Your Sprite
Lesson 4keeping a record
Lesson 5The next level

Evaluation

[1.] Can it display "the level number", wait a bit before starting.
[2.] How would you add level 3 to the game.
[3.] Add another crab to make it two.
[4.] Try making the Crab to move a little faster.
[5.] Explain how to accomplished each task and it's challenges.

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.

Source manuelhooks


Cc
@steemkidss
@ngoenyi
@benton3
@goodybest
@eliany
@patjewell

Written by @manuelhooks for steemkids

fintech steemexclusive learnwithsteem nigeria club100 scratche

Sort:  
Your post has been successfully curated by our team via @fredquantum 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.

Loading...
 2 years ago 

Another great lesson!
Thank you!

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

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.028
BTC 63624.94
ETH 3481.95
USDT 1.00
SBD 2.54