Lesson Four – Scratch 2.0 and the XY-Grid

Introduction to Scratch 2.0 – Lesson Four

Scratch 2.0 and the xy-grid

Let’s work with coordinates!

In this lesson, we are going to learn how to use the x and y coordinates in Scratch. At the end of this lesson, you should know how to:

  • identify x and y coordinates
  • write a script to make a shape using the x and y coordinates
  • add the x and y background to your animation

Sign In
First, you need to log in to the Scratch web site. Remember to choose the “create” tab to access the editor.

Scratch_lesson1_create2

New Project
For this project, we are going to make a new project. When you click on the “create” tab, Scratch automatically gives you a new project, so you just need to rename your project. Let’s call this project “Shapes” or “Shapes and xy grid.” We want to describe our project when we name it so that it is easy to find later.

Scratch_4th_naming_your_project

 

 

 

 

XY Coordinate Grid
The Scratch programming language is based on a coordinate plane. A coordinate plane is a set of points, based on the size of the space. In this case, our image size is 480 x 360 pixels.

Scratch_lesson_4th_xygrid_pixels

 

 

 

 

 

 

 

 

A single point would have both X and Y coordinates. We would use the single point to start our sprite in the same position each time we click the green flag. In the image below, the dinosaur sprite has coordinates of x: -109, y: 113 . There is a dash (-) before the 109. That means it is a negative number. You don’t have to understand what that means, but just know that the dash (-) is important in an xy grid.

Scratch_4th_lesson_sprite_coordinates

 

 

 

 

 

 

 

 

Video Lesson
In the video below, I’ll show you how to use the coordinates in the scripts you write. Don’t worry if the xy grid still seems confusing. All you need to know is how to use it and the video shows you how to do just that! When you are finished watching the video, come back and try out the practice exercises.

Video

Practice
Answer the following questions to become a better Scratch programmer.

1. What happens if you use the program below?
Screen Shot 2015-02-10 at 8.34.25 PM

 

 

 

2. What if we used this program instead?
Screen Shot 2015-02-10 at 8.35.15 PM

 

 

 

3. Can you make your sprite start at (x: 0, y: 0) and glide to the top left (x: -177, y: 133) and the bottom right (x: 181, y: -104) of your screen?

Completed Course

Congratulations on finishing the Introductory Learn Scratch class. You are now familiar with the programming language, Scratch, and you can start to make your own creations. If you are interested in continuing your learning with Artisan Education, check out our other online course options.