Working with Motion Code Blocks

To move sprites around the stage when your Scratch applications execute, you need to learn how to work with motion code blocks. As previously stated, motion blocks control sprite placement, direction, rotation, and movement. In total, Scratch provides access to 16 different motion blocks, which you can work with by clicking on the Motion button located at the top of the blocks palette and then dragging and dropping motion blocks onto the scripts area, where you can configure them and use them in creating scripts.

If you look closely at the various motion code blocks, you will notice that Scratch organizes them into six subgroupings, each of which is separated by a blank space in the blocks palette. These sub groupings include:

  • Motion blocks that move and rotate sprites

  • Motion blocks that point sprites in different directions or towards different objects

  • Motion blocks that change a sprite’s location and control whether a sprite jumps to its new location or glides to it

  • Motion blocks that change a sprite location by setting or modifying the value of its X-axis and Y-axis coordinates

  • A motion block that controls a sprite’s movement when it touches the edges of the stage

  • Motion blocks that report on a sprite’s position and direction

Examples of how to work with the motion code blocks in each of these subgroups are provided throughout the rest of this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.63.136