From Test-Scratch-Wiki

Revision as of 20:16, 12 June 2016 by InterwikiBot (talk | contribs) (Uploading Page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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