Programming for kids: [lesson #3] Animating Your Sprite

in Steem Kids & Parents2 years ago (edited)

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

Coding With Scratch

The jumping sprite Game

In our previous lesson, you saw how to make our Sprite jump when we tap on the screen, but that is not all because one may ask the question, is that all?, What is it jumping for?

Let's start with the fact that the jumping sprite is just a segment of a more complex whole. This class will be giving the cat something to jump over.

Our plan is to create a Sprite that will move towards the cat and the cat will have to jump over the moving object each time it comes close to it.


Now let's convert this plan into action using scratch.

Get to the address bar and enter https://scratch.mit.edu and refer to our first lesson on how to get the scratch environment ready for use.

Create a new sprite

Here is the previous work we did and we are about to add a new sprite to the list.
photostudio_1658057207683.png

Adding a new sprite
To add a new sprite
• we will go to the sprite info pane.
• Select the sprite button
• we want to select from existing sprites.
• Select the animal category
• Select the crab or any sprite you like.

We now have two sprites
photostudio_1658058542476.png
The Cat and the Crab sprite. The crab is active at the moment. That is why we have a faint crab at the top right of the scripting Area.

Positioning the sprites
We will love to have the cat at the left and the Crab coming from the right. This block can be used to set the exact locations on for a sprite
photostudio_1658063019879.png
Cartesian coordinate are used to position the sprite correctly on the screen. If you should drag the crab on the stage area to the location you will want it to be, the sprite info pane are will provide the Cartesian coordinate for the location which can be copied out.

photostudio_1658066151275.png
Got the crab

To make the sprite move
The glide block will make the sprite move from one point to another within the specified time.
photostudio_1658077863125.png
The glide block is assisted by a control and an event blocks. The forever control block makes sure the gliding movement hose on and on. The small move block is responsible for maintaining the position of the crap.
photostudio_1658078426957.png

When the jump is not successful
photostudio_1658077272644.png
This script will stop the game once the crab touches the cat. You can only play again if you restart using the green flag.
This block starts with the flag and will wait till the sensing part of it feels the crap touching the cat and only then will it go over to the next block that stops the whole processes. The sensor is created using the "wait until" control with a sensing block fitted inside it.
photostudio_1658079384270.png
The sensing block is edited so it reacts when it touches the cat(sprite 1)

The final script

Script for the cat
photostudio_1658076895013.png

Script for the crap
photostudio_1658076809550.png

What next

In lesson 4, we will introduce a counter to record the number of successful jumps and after a specific number of jumps we should have another level.

Lesson 1Introduction
Lesson 2Getting Started
Lesson 3Animating Your Sprite

Evaluation

[1.] Create a post with screenshot and explanations showing the following

[2.] How you positioned a sprite

[3.] how to make a Sprite smaller

[4.] What were your challanges

Rules
You must be a verified kid (No parent assistance)
Your homework post should be at least 300 words.
Post in steemkids Community and set aside at least 10% beneficiary to @steemkidss.
You must belong to any of these clubs, club5050 #club75 and club100
Use the tags #learnwithsteem and #steemexclusive #yourcountry, #assignment and your club status as part of your hashtag.
Drop your entry link at the comment section.
All participants who perform well will be rewarded.

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

Written by @manuelhooks for steemkids

learnwithsteem steemexclusive nigeria club75 steem scratch technology

Sort:  
 2 years ago 

Another great post for the kids!
Thank you!

 2 years ago 

Thanks for appreciating my post.

Thank you for contributing to #LearnWithSteem theme. This post has been upvoted by @Reminiscence01 using @steemcurator09 account. We encourage you to keep publishing quality and original content in the Steemit ecosystem to earn support for your content.

Club Status: #Club75

Sevengers Comment GIF.gif

Regards,
Team #Sevengers

Loading...

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.31
TRX 0.11
JST 0.034
BTC 64332.82
ETH 3146.25
USDT 1.00
SBD 4.17