This commit is contained in:
Mashy 2018-11-19 22:09:47 +10:00
parent bd3ffdc123
commit 3c5199d710

View File

@ -1,23 +0,0 @@
const Phaser = require('phaser');
const ROW_WIDTH = 400;
const ROW_HEIGHT = 200;
const ROW_FILL = 0x888888;
const TOP_MARGIN = 50;
const ROW_MARGIN = 50;
const TEXT_MARGIN = 24;
class CrypInfo extends Phaser.GameObjects.Rectangle {
constructor(scene, cryp, i) {
const X_ORIGIN = 0;
const Y_ORIGIN = (i * ROW_HEIGHT + ROW_MARGIN) + TOP_MARGIN;
super(scene, X_ORIGIN, Y_ORIGIN, ROW_WIDTH, ROW_HEIGHT, ROW_FILL * Math.random());
this.setOrigin(0);
this.cryp = cryp;
scene.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 0), cryp.name, { fontFamily: 'Arial', fontSize: 24, color: '#ffffff', fontStyle: 'bold' });
scene.add.text(X_ORIGIN, Y_ORIGIN + (TEXT_MARGIN * 1), cryp.stamina.base, { fontFamily: 'Arial', fontSize: 24, color: '#ffffff', fontStyle: 'bold' })
}
}
module.exports = CrypInfo;