Add specs

This commit is contained in:
Mashy 2019-03-06 17:19:31 +10:00
parent 5ea6b911ad
commit c036750a4b

View File

@ -87,6 +87,19 @@ class StatSheet extends Phaser.Scene {
this.add.existing(itemObj);
};
cryp.skills.forEach(knownSkill);
this.add.text(X + WIDTH * 0.175, Y, 'Skills', TEXT.HEADER);
this.add.text(X + WIDTH * 0.175, Y + HEIGHT * 0.25, 'Specs', TEXT.HEADER);
const knownSpec = (spec, i) => {
const SKILL_X = X + WIDTH * 0.21 + WIDTH * 0.125 * i;
const SKILL_Y = Y + HEIGHT * 0.4;
const itemObj = new Item(this, spec, i, SKILL_X, SKILL_Y, SKILL_WIDTH, Math.floor(SKILL_WIDTH / 2));
// itemObj.on('pointerdown', () => );
this.input.setDraggable(itemObj);
this.add.existing(itemObj);
};
cryp.specs.forEach(knownSpec);
this.input.on('drag', (pointer, item, dragX, dragY) => {
if (!(item instanceof Item)) return false;