pxt-calliope/docs/reference/game/touching.md
2016-07-08 16:34:56 -07:00

276 B

Touching

Reports true if sprite is touching specified sprite

let matter = game.createSprite(2, 2);
let antimatter = game.createSprite(2, 2);
if (matter.isTouching(antimatter)) {
    basic.pause(500);
    basic.clearScreen();
    basic.showString("BOOM!");
}