Presentation is loading. Please wait.

Presentation is loading. Please wait.

Moving Sprites in Scratch

Similar presentations


Presentation on theme: "Moving Sprites in Scratch"— Presentation transcript:

1 Moving Sprites in Scratch
Exploring Computer Science – Lesson 4-4

2 Objectives The students will be able to:
Make a sprite move to a specified location. Change the direction a sprite is facing and therefore moving. Reinitialize a Scratch program.

3 Discussion Briefly describe how you graph something in your Algebra class. Draw me an example graph with 5 points that, when connected, create an image. Tell me the points that you graphed.

4 On your own… Download the file moving.sb from the Hancock Web Site.
Open moving.sb in scratch. Download Homework 4-4 as well. It is a Word document. Complete the homework. Print out your homework when done. MAKE SURE IT IS ON ONE PAGE! Change the font size if it isn’t!

5 The Stage The “stage” in Scratch is simply a Cartesian coordinate system with point (0,0) in the middle:

6 Moving Blocks The “move” block moves the sprite forward that many units. The direction depends on which way the sprite is facing.

7 Moving Blocks The “go to” block instantly moves the sprite to that coordinate on the stage. The direction the sprite is facing will not change.

8 Moving Blocks The “glide” block moves the sprite to that coordinate on the stage. But unlike the “go to” block, the sprite will slowly or quickly move across the screen to that location depending on the number of seconds you specify. The direction the sprite is facing will not change.

9 Repeat Blocks The “repeat block” will do a section of code a set number of times. This is called iteration or looping. Iteration is a programming concept common to all programming languages.

10 Start Blocks The code in a “when green flag clicked” block is executed when the user clicks on the green flag to run the program. Use this block and the “go to” block to move sprites back to their original position.

11 Rest of Today and First Part of Monday
Download baseball.sb from the Hancock website. Use what you’ve learned about moving to get the cat to run the bases (as realistically as possible – bases are run counter clockwise) in baseball.sb. The cat should face the right way as it runs (i.e., not run backwards). Make sure that when you click the green flag, the cat starts at home plate again. Extra Credit: Make the cat change costumes so that it looks like it is running as it circles the bases.

12 Rubric Do you… Points Possible What Do You Think?
Have your sprite realistically moving (i.e., not hopping, jumping, appearing, etc.) from home to first? 15 Have your sprite realistically moving from first to second? Have your sprite realistically moving from second to third? Have your sprite realistically moving from third to home? Have your sprite facing the right way as it runs (i.e., not running backwards)? 20 Have your sprite running forever until the stop sign is hit? 8 Have your sprite reinitializing to home when you click the green flag? 12 Extra Credit Have your sprite changing costumes so that it looks like it is running as it circles the bases? TOTAL: 100


Download ppt "Moving Sprites in Scratch"

Similar presentations


Ads by Google