Add isDeleted (#2445)

This commit is contained in:
Franklin Tse
2019-09-25 20:47:25 +08:00
committed by Peli de Halleux
parent a10a69b96c
commit 19dffde1a8
4 changed files with 45 additions and 1 deletions

View File

@ -695,7 +695,7 @@ namespace game {
* Deletes the sprite from the game engine. The sprite will no longer appear on the screen or interact with other sprites.
* @param this sprite to delete
*/
//% weight=59 help=game/delete
//% weight=59 blockGap=8 help=game/delete
//% blockId="game_delete_sprite" block="delete %this(sprite)"
public delete(): void {
this._enabled = false;
@ -703,6 +703,15 @@ namespace game {
plot();
}
/**
* Reports whether the sprite has been deleted from the game engine.
*/
//% weight=58 help=game/is-deleted
//% blockId="game_sprite_is_deleted" block="is %sprite|deleted"
public isDeleted(): boolean {
return !this._enabled;
}
/**
* Sets the blink duration interval in millisecond.
* @param sprite TODO