active fill

This commit is contained in:
ntr 2018-11-20 22:48:26 +11:00
parent e4c9efc4ec
commit 7b359f7fb4

View File

@ -27,15 +27,18 @@ class CrypRow extends Phaser.GameObjects.Group {
const X_ORIGIN = xPos(i); const X_ORIGIN = xPos(i);
const Y_ORIGIN = yPos(i); const Y_ORIGIN = yPos(i);
// only draw for active cryps const ACTIVE_FILL = cryp.active
if (cryp.active) { ? 1
: 0;
const row = list.add const row = list.add
.rectangle(X_ORIGIN, Y_ORIGIN, ROW_WIDTH, ROW_HEIGHT, ROW_FILL * Math.random()) .rectangle(X_ORIGIN, Y_ORIGIN, ROW_WIDTH, ROW_HEIGHT, ROW_FILL * Math.random(), ACTIVE_FILL)
.setInteractive() .setInteractive()
.setOrigin(0); .setOrigin(0);
this.add(row);
row.cryp = cryp; row.on('pointerdown', () => {
} list.displaySkills(cryp);
});
if (KEY_MAP[i]) { if (KEY_MAP[i]) {
this.keyboard.on(KEY_MAP[i], () => { this.keyboard.on(KEY_MAP[i], () => {
@ -43,6 +46,8 @@ class CrypRow extends Phaser.GameObjects.Group {
}, this); }, this);
} }
row.cryp = cryp;
this.add(row);
this.add(list.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 0), cryp.name, TEXT.HEADER)); this.add(list.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 0), cryp.name, TEXT.HEADER));
this.add(list.add.text(ROW_WIDTH - 20, Y_ORIGIN + (TEXT_MARGIN * 0), i + 1, TEXT.HEADER)); this.add(list.add.text(ROW_WIDTH - 20, Y_ORIGIN + (TEXT_MARGIN * 0), i + 1, TEXT.HEADER));
this.add(list.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 1), cryp.stamina.base, TEXT.NORMAL)); this.add(list.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 1), cryp.stamina.base, TEXT.NORMAL));