Retrieving Stage and Sprite Data

In addition to determining mouse status, sprite collisions, and the distance between sprites, you can use the code block shown in Figure 6.12 to retrieve sprite and stage information.

Figure 6.12. This sensing block can be used to retrieve information about a number of object attributes.


This code block provides easy access to a number of pieces of information, including:

  • X position

  • Y position

  • Direction

  • Costume number

  • Size

  • Volume

As an example of how to work with this code block, take a look at the following script, which retrieves the X coordinate of a sprite named Sprite 2 and plays an audio file whenever that sprite is moved to the right-hand side of the stage (between coordinates 1 and 240).

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

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