1.3 XY Grid

Students will continue to explore the XY Coordinate grid in Scratch, and use it to practice moving a sprite around the stage.

OBJECTIVES


OBJECTIVES: By the end of this lesson, students will:

    • explore sprite movement with XY coordinates.

    • distinguish between set and change.

TEACHER RESOURCES:


Standards

  • CSTA 1B-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.


CSTA

Do Now (5 minutes)


Diversity in Tech

Students watch the Coding with Stephen Curry (1.26) then discuss:

    1. Why does Stephen Curry think that the opportunities are endless for people getting into computer science?

    2. Why does Stephen Curry believe "It is extremely important to have perseverance when learning new skills"?

TEACHER GUIDANCE

  • Computer science jobs are in high demand right now.

  • Anything that is worth doing, usually does not come easily, but you know in the end it will pay off.

Mini-Lesson (5-10 minutes)

TEACHER GUIDANCE:

Student knowledge of the cartesian X,Y Grid is useful but non-essential.

In scratch, when you drag a sprite on the stage and release, the new (X,Y) location of the sprite is updated all commands.

So if students move a sprite to it's initial position, then grab a goto command it will have the updated positional location information.

If students then move this sprite to it's final location and grab a glide command, glide will be updated with the final location information.


Students use blocks from the blue Motion category in Scratch to complete this assignment.

Set blocks set an absolute location on the coordinate grid in Scratch; "go to" is another version of the "set" blocks.

  • Setting x to 100 will move the sprite to the exact location of x=100 on the coordinate grid.

Change blocks change the location relative to where the sprite currently is.

  • Changing y by 10 will move the sprite 10 units up; this can be performed multiple times, changing the sprite's location until it reaches the edge of the coordinate grid.

PROJECT ( 30 minutes)

Agenda

Close-Out (5 minutes)

Discuss the following questions:

  • What is the difference between the set blocks and the change blocks?

    • What blocks will move the sprite to certain x,y position?

Potential Responses

  • Set ignores the current value and sets it to a specific value, change adds or subtracts from the current value.

  • go to (adjusts both X and Y coordinates at the same time) and glide (animates the sprite's movement to a specific X and Y coordinate).