From 99cc1443612e5f2a6d737e778d0809008b050b22 Mon Sep 17 00:00:00 2001 From: Mashy Date: Sun, 17 Feb 2019 12:02:32 +1000 Subject: [PATCH] added bound --- client/src/scenes/vbox.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/client/src/scenes/vbox.js b/client/src/scenes/vbox.js index aa4729c6..048898c8 100644 --- a/client/src/scenes/vbox.js +++ b/client/src/scenes/vbox.js @@ -13,9 +13,10 @@ class Vbox extends Phaser.Scene { create(vbox) { this.cameras.main.setViewport(X, Y, WIDTH, HEIGHT); - this.add.text(WIDTH / 10, 0, 'VariBox', TEXT.HEADER) + this.add.text(WIDTH / 10, 0, 'free', TEXT.HEADER); + this.add.text(WIDTH / 5, 0, 'bound', TEXT.HEADER); - const drawItem = (item, i) => { + const drawFree = (item, i) => { this.add .text(WIDTH / 10, 25 * (i + 2), item, TEXT.NORMAL) .setInteractive() @@ -23,9 +24,19 @@ class Vbox extends Phaser.Scene { this.registry.get('ws').sendVboxAccept(vbox.game, i); console.log(item); }); -; }; - vbox.free.forEach(drawItem); + + const drawBound = (item, i) => { + this.add + .text(WIDTH / 5, 25 * (i + 2), item, TEXT.NORMAL) + .setInteractive() + .on('pointerdown', () => { + // this.registry.get('ws').sendVboxAccept(vbox.game, i); + console.log(item); + }); + }; + vbox.free.forEach(drawFree); + vbox.bound.forEach(drawBound); } cleanUp() {