diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 4eeeb0fa..648bb439 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -240,6 +240,8 @@ "serial.delimiters": "Returns the delimiter corresponding string", "serial.onDataReceived": "Registers an event to be fired when one of the delimiter is matched.", "serial.onDataReceived|param|delimiters": "the characters to match received characters against.", + "serial.readBuffer": "Reads multiple characters from the rxBuff and fills a user buffer.", + "serial.readBuffer|param|length": "default buffer length, eg: 64", "serial.readLine": "Reads a line of text from the serial port.", "serial.readString": "Reads the buffered received data as a string", "serial.readUntil": "Reads a line of text from the serial port and returns the buffer when the delimiter is met.", @@ -248,6 +250,7 @@ "serial.redirect|param|rate": "the new baud rate. eg: 115200", "serial.redirect|param|rx": "the new reception pin, eg: SerialPin.P1", "serial.redirect|param|tx": "the new transmission pins, eg: SerialPin.P0", + "serial.writeBuffer": "Sends a buffer through Serial connection", "serial.writeLine": "Prints a line of text to the serial", "serial.writeNumber": "Prints a numeric value to the serial", "serial.writeString": "Sends a piece of text through Serial connection.", diff --git a/libs/core/game.ts b/libs/core/game.ts index 79977275..c008da06 100644 --- a/libs/core/game.ts +++ b/libs/core/game.ts @@ -46,8 +46,6 @@ namespace game { export function createSprite(x: number, y: number): LedSprite { init(); let p = new LedSprite(x, y); - sprites.push(p); - plot(); return p; } @@ -648,9 +646,10 @@ namespace game { * @param this sprite to delete */ //% weight=59 - //% blockId="game_delete_sprite" block="delete %this" + //% blockId="game_delete_sprite" block="delete %this" public delete(): void { - sprites.removeElement(this); + if (sprites.removeElement(this)) + plot(); } /**