From Test-Scratch-Wiki

Translate: - English 
DocumentInQuestion.png It has been suggested that this page's contents be merged with the page Distance to () (block). You can discuss this on the page's talk page.

Distance is a value that detects how far away a sprite is to another sprite's costume center, in pixels.

Detecting Distance

The Scratch Cat saying his distance from the clam.

The associated block has a drop-down menu. Select the sprite you want to detect the distance from, and get the distance to display through a variable's stage monitor, the Say () block, etc.

If there is nothing in the drop-down insert of the block, or if a sprite that was deleted is still in the drop-down insert, it reports the distance as 0.

Example Uses

Here are some ways this value can be used:

  • Detecting distances from an invisible sprite and displaying the score as a game
  • Making a variable change when you move the sprite around from another sprite

See Also