Sprite Position and Direction

  1. Need to support students in learning geometry of angles and diagonals somewhere
  2. Paul, whatever you keep here, consider if they should be saving at the end. --MF
  3. Also, there was a GH comment suggesting that we "introduce the students to animation... This would be beneficial for their create task (ap exam final project)."
  4. MF: Consider including something like the python tutorial L, T, and checkmark problems...

This lab will summarize, clarify, and extend the ideas you have been studying in Unit 1.

  1. Change the stage's background to xy-grid so that you see the coordinate plane grid and axes. The instructions and video below will remind you how.
    1. In the Sprite Corral (just below the screen), click the Stage button.
    2. There are also other backgrounds built into snap that you can use for other projects, or you can drag your own pictures in.
    3. Then, choose "Backgrounds" from the snap File menu, File button .
    4. Choose "xy-grid.gif" to show the grid.

    video reminder of how to change stage background

  2. You will have to select the Sprite in the Sprite Corral to make the Motion blocks reappear. The Stage doesn't have Motion blocks.
    In the blue Motion palette, check the gray check-boxes next to the x position, y position, and direction blocks. That creates "watchers" on the stage, boxes that show the x and y coordinates of your sprite and the direction it is pointing.
    X Position block's checkbox  X Position stage watcher
  3. Pair Programming Swap
  4. Drag the sprite around with your mouse. Also use move and turn to control the sprite. Notice which actions change which values.
  5. Experiment to determine which part of the sprite the coordinates are describing. (Head? Tail? Center?)

Your stage should look like this with axes, a grid, the origin, and 3 watchers: x position, y position, and direction.

Some programming languages treat the top left corner of the screen as the origin: coordinates get bigger as you move down and right, with no negative coordinates. snap uses the same coordinates you use in algebra.

Coordinate Grid

grid and axes on Snap stage with sprite watchers

snap 's coordinates work the way you've learned in mathematics. Direction in snap works differently. snap uses 0 to mean "pointing North" (up) and 90 to mean "pointing East," (right) and so on. This is how compass directions are expressed.

(Mathematics uses a different convention: 0° for pointing in the positive direction along the x-axis, that is, toward the right, increasing as we turn counter-clockwise toward the north (90°) and beyond.)

  1. What are the position coordinates of the sprite in the image above?
  2. In what direction is the sprite pointing?