pxt-calliope/docs/reference/game/touching.md

14 lines
276 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Touching
Reports true if sprite is touching specified sprite
```blocks
let matter = game.createSprite(2, 2);
let antimatter = game.createSprite(2, 2);
if (matter.isTouching(antimatter)) {
basic.pause(500);
basic.clearScreen();
basic.showString("BOOM!");
}
2016-03-26 00:47:20 +01:00
```