Moving Sprites in Scratch Exploring Computer Science Lesson

  • Slides: 10
Download presentation
Moving Sprites in Scratch Exploring Computer Science – Lesson 4 -4

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

Journal Entry ● Briefly describe how you graph something in your Algebra class. ●

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

What do you think… ● Download the file moving. sb from Google Drive. ●

What do you think… ● Download the file moving. sb from Google Drive. ● Open moving. sb in scratch. ● 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. ● Make sure you submit when done!

The Stage ● The “stage” in Scratch is simply a Cartesian coordinate system with

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

Moving Blocks ● The “move” block moves the sprite forward that many units. ●

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

Moving Blocks ● The “go to” block instantly moves the sprite to that coordinate

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

Moving Blocks ● The “glide” block moves the sprite to that coordinate on the

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 direction the sprite is facing will not change.

Repeat Blocks ● The “repeat block” will do a section of code a set

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.

Start Blocks ● The code in a “when green flag clicked” block is executed

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

Rest of Today and First Part of Monday ● Use what you’ve learned about

Rest of Today and First Part of Monday ● Use what you’ve learned about moving to get the cat to run the bases (as realistically as possible – bases are run counter clockwise. ● 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.