From 10aeeaabf4aaaf1e279bcc14b615318b796470a6 Mon Sep 17 00:00:00 2001 From: Franklin Tse Date: Wed, 2 Oct 2019 13:38:12 +0800 Subject: [PATCH] isTouchingEdge() should not return true for deleted sprite (#2449) --- libs/core/game.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/game.ts b/libs/core/game.ts index e1de6cfa..103741b4 100644 --- a/libs/core/game.ts +++ b/libs/core/game.ts @@ -633,7 +633,7 @@ namespace game { //% weight=19 help=game/is-touching-edge //% blockId=game_sprite_touching_edge block="is %sprite|touching edge" blockGap=8 public isTouchingEdge(): boolean { - return this._x == 0 || this._x == 4 || this._y == 0 || this._y == 4; + return this._enabled && (this._x == 0 || this._x == 4 || this._y == 0 || this._y == 4); } /**