exposing delete in blocks
This commit is contained in:
parent
2ae21efb7b
commit
d457c3e8d0
@ -589,7 +589,7 @@ namespace game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns on the sprite (on by default)
|
* Turns on the sprite (on by default)
|
||||||
* @param this TODO
|
* @param this the sprite
|
||||||
*/
|
*/
|
||||||
public on(): void {
|
public on(): void {
|
||||||
this.setBrightness(255);
|
this.setBrightness(255);
|
||||||
@ -597,7 +597,7 @@ namespace game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns off the sprite (on by default)
|
* Turns off the sprite (on by default)
|
||||||
* @param this TODO
|
* @param this the sprite
|
||||||
*/
|
*/
|
||||||
public off(): void {
|
public off(): void {
|
||||||
this.setBrightness(0);
|
this.setBrightness(0);
|
||||||
@ -605,8 +605,8 @@ namespace game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the ``brightness`` of a sprite
|
* Set the ``brightness`` of a sprite
|
||||||
* @param this TODO
|
* @param this the sprite
|
||||||
* @param brightness TODO
|
* @param brightness the brightness from 0 (off) to 255 (on), eg: 255.
|
||||||
*/
|
*/
|
||||||
//% parts="ledmatrix"
|
//% parts="ledmatrix"
|
||||||
public setBrightness(brightness: number): void {
|
public setBrightness(brightness: number): void {
|
||||||
@ -616,8 +616,9 @@ namespace game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports the ``brightness` of a sprite on the LED screen
|
* Reports the ``brightness` of a sprite on the LED screen
|
||||||
* @param this TODO
|
* @param this the sprite
|
||||||
*/
|
*/
|
||||||
|
//% parts="ledmatrix"
|
||||||
public brightness(): number {
|
public brightness(): number {
|
||||||
let r: number;
|
let r: number;
|
||||||
return this._brightness;
|
return this._brightness;
|
||||||
@ -625,8 +626,8 @@ namespace game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the ``y`` position by the given amount
|
* Changes the ``y`` position by the given amount
|
||||||
* @param this TODO
|
* @param this the sprite
|
||||||
* @param value TODO
|
* @param value the value to change brightness
|
||||||
*/
|
*/
|
||||||
public changeBrightnessBy(value: number): void {
|
public changeBrightnessBy(value: number): void {
|
||||||
this.setBrightness(this._brightness + value);
|
this.setBrightness(this._brightness + value);
|
||||||
@ -643,10 +644,11 @@ namespace game {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the sprite from the game engine. All further operation of the sprite will not have any effect.
|
* Deletes the sprite from the game engine. All further operation of the sprite will not have any effect.
|
||||||
* @param sprite TODO
|
* @param this sprite to delete
|
||||||
*/
|
*/
|
||||||
public delete(sprite: LedSprite): void {
|
//% blockId="game_delete_sprite" block="delete %this"
|
||||||
sprites.removeElement(sprite);
|
public delete(): void {
|
||||||
|
sprites.removeElement(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user