Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4."— Presentation transcript:

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

2 Journal Entry Briefly describe how you graph something in your Algebra class. Briefly describe how you graph something in your Algebra class. Draw me an example graph with 5 points. Draw me an example graph with 5 points. Tell me the points that you graphed Tell me the points that you graphed

3 What do you think… Download the file moving.sb from the Hancock Web Site. Download the file moving.sb from the Hancock Web Site. Open moving.sb in scratch. Open moving.sb in scratch. Click on the “Click here for the Homework” link on the web site. Click on the “Click here for the Homework” link on the web site. Complete the homework. A word version of the questions is also on the website. You might want to have that open. Complete the homework. A word version of the questions is also on the website. You might want to have that open. Make sure you submit when done! Make sure you submit when done!

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

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

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

7 Moving Blocks The “glide” block moves the sprite to that coordinate on the stage but unlike the “go to” block the sprite will move across the screen to that location. The “glide” block moves the sprite to that coordinate on the stage but unlike the “go to” block the sprite will move across the screen to that location. The direction the sprite is facing will not change. The direction the sprite is facing will not change.

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

9 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. 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 to move sprites to their original position. Use this to move sprites to their original position.

10 Rest of Today and Friday Download baseball.sb from the Hancock website. 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) 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. 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. Extra Credit: Make the cat change costumes so that it looks like it is running as it circles the bases.


Download ppt "Moving Sprites in Scratch Exploring Computer Science – Lesson 4-4."

Similar presentations


Ads by Google