show cryp stats on main page
This commit is contained in:
parent
09c0a624d9
commit
c8fb2a2751
@ -1,6 +1,6 @@
|
||||
const Phaser = require('phaser');
|
||||
|
||||
const { TEXT, COLOURS, POSITIONS: { CRYP_LIST, MENU } } = require('./constants');
|
||||
const { TEXT, COLOURS, POSITIONS: { CRYP_LIST, MENU, STATS } } = require('./constants');
|
||||
|
||||
const TEXT_MARGIN = 24;
|
||||
|
||||
@ -45,9 +45,20 @@ class CrypRows extends Phaser.GameObjects.Group {
|
||||
|
||||
row.cryp = cryp;
|
||||
this.add(row);
|
||||
|
||||
const crypStat = (stat, j) => {
|
||||
const STAT_X = 0;
|
||||
const STAT_Y = (j * TEXT_MARGIN) + ROW_Y + TEXT_MARGIN;
|
||||
|
||||
const text = list.add.text(STAT_X, STAT_Y, `${stat.stat}: ${stat.base}`, TEXT.NORMAL);
|
||||
this.add(text);
|
||||
};
|
||||
|
||||
const CRYP_STATS = [cryp.stamina, cryp.phys_dmg, cryp.spell_dmg];
|
||||
CRYP_STATS.forEach(crypStat);
|
||||
|
||||
this.add(list.add.text(ROW_WIDTH - 20, ROW_Y, i + 1, TEXT.HEADER));
|
||||
this.add(list.add.text(ROW_X, ROW_Y + (TEXT_MARGIN * 0), cryp.name, TEXT.HEADER));
|
||||
this.add(list.add.text(ROW_X, ROW_Y + (TEXT_MARGIN * 1), cryp.stamina.base, TEXT.NORMAL));
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ function createSocket(events) {
|
||||
|
||||
if (!account) events.loginPrompt();
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
|
||||
send({ method: 'account_login', params: { name: 'ntr', password: 'grepgrepgrep' } });
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user