Cox Rocks



Module 4: Motion CommandsApple Drop Game (EC) InstructionsDescription:In this assignment, apples appear at random horizontal positions at the top of the Stage at random times and fall to the ground. The player has to move the cart to catch the apples before they touch the ground, and each apple is worth 1 point.02706Image 1:?The Apple Drop gameAt first, you might think such a game requires many sprites with nearly identical scripts. After all, there are a lot of apples. In Scratch, however, that is not the case. With the?cloning?feature, you can easily create a bunch of copies of a sprite. In our Apple Drop game, we'll use a single apple sprite and create as many clones as we desire.Instructions:Open the file?CatchApples_NoCode.sb2 From Canvas, which contains the setup for our game without scripts. To make things a little more exciting, the setup also includes a variable named?score, which we'll use to keep track of the caught apples.?337682294888First, you'll make the script for the?Cart?sprite as shown in the image below.Image 2:?The script for the?Cart?spriteTo create the cloning, start by adding the script shown in the image below to the?Apple?sprite. This scripts also starts running when the green flag is clicked.361425413716Image 3:?The first script of the?Apple?sprite222222743392If you run the game now by clicking the green flag, 30 apples will pop up randomly at the top of the Stage and stay there--because we haven't told the cloned apples what to do. This is where the next script for the?Apple?sprite, shown in the image below, comes in.Image 4:?The second script for the?Apple?spriteNow that our apples know how to fall, the game is complete! Go ahead and test it out by clicking the green of FormBottom of Form ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download