diff options
Diffstat (limited to 'desktop/core/lib/k.js')
-rw-r--r-- | desktop/core/lib/k.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/desktop/core/lib/k.js b/desktop/core/lib/k.js new file mode 100644 index 0000000..d18bc86 --- /dev/null +++ b/desktop/core/lib/k.js @@ -0,0 +1,28 @@ +'use strict' + +const FnBase = require('./_base') + +function FnK (pico, x, y) { + FnBase.call(this, pico, x, y) + + this.name = 'kill' + this.glyph = 'k' + this.info = '[TODO]Kills southward fns, on bang.' + this.ports = [{ x: 0, y: 0, bang: true }, { x: 0, y: 1 }, { x: 0, y: -1 }, { x: 1, y: 0 }, { x: -1, y: 0 }] + + this.operation = function () { + if (this.bang()) { + pico.remove(this.x - 1, this.y) + pico.remove(this.x + 1, this.y) + pico.remove(this.x, this.y + 1) + pico.remove(this.x, this.y - 1) + + pico.lock(this.x, this.y + 1) + pico.lock(this.x, this.y - 1) + pico.lock(this.x + 1, this.y) + pico.lock(this.x - 1, this.y) + } + } +} + +module.exports = FnK |