Moved variables into constants file
This commit is contained in:
parent
593a2da7b0
commit
5776b1371f
@ -1,12 +1,11 @@
|
||||
const Phaser = require('phaser');
|
||||
const genAvatar = require('./avatar');
|
||||
const StatBar = require('./elements/statbar');
|
||||
const StatBar = require('./elements/combat.statbar');
|
||||
|
||||
const { DELAYS, TEXT, POSITIONS: { COMBAT } } = require('./constants');
|
||||
|
||||
const CRYP_MARGIN = COMBAT.height() / 4.5;
|
||||
const TEXT_MARGIN = COMBAT.height() / 35;
|
||||
|
||||
const CRYP_MARGIN = COMBAT.crypMargin();
|
||||
const TEXT_MARGIN = COMBAT.textMargin();
|
||||
|
||||
const crypAvatarText = (team, iter) => {
|
||||
const nameX = COMBAT.width() * team;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
const Phaser = require('phaser');
|
||||
const { POSITIONS: { COMBAT } } = require('./constants');
|
||||
|
||||
const CRYP_MARGIN = COMBAT.height() / 4.5;
|
||||
const CRYP_MARGIN = COMBAT.crypMargin();
|
||||
const BOX_HEIGHT = CRYP_MARGIN * 0.8;
|
||||
const BOX_WIDTH = COMBAT.width() * 0.2;
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@ const combatWidth = () => CANVAS_WIDTH;
|
||||
const combatHeight = () => CANVAS_HEIGHT - headerHeight();
|
||||
const combatY = () => headerHeight();
|
||||
const combatX = () => 0;
|
||||
const combatCrypMargin = () => Math.floor((CANVAS_HEIGHT - headerHeight()) / 4.5);
|
||||
const combatTextMargin = () => Math.floor((CANVAS_HEIGHT - headerHeight()) / 35);
|
||||
|
||||
const statsWidth = () => Math.floor(CANVAS_WIDTH - menuCrypListWidth());
|
||||
const statsHeight = () => CANVAS_HEIGHT - headerHeight();
|
||||
@ -107,6 +109,9 @@ module.exports = {
|
||||
y: combatY,
|
||||
width: combatWidth,
|
||||
height: combatHeight,
|
||||
crypMargin: combatCrypMargin,
|
||||
textMargin: combatTextMargin,
|
||||
|
||||
|
||||
LOG: {
|
||||
x: logX,
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
const Phaser = require('phaser');
|
||||
const { TEXT, POSITIONS: { COMBAT }, COLOURS } = require('.././constants');
|
||||
|
||||
const CRYP_MARGIN = COMBAT.height() / 4.5;
|
||||
const TEXT_MARGIN = COMBAT.height() / 35;
|
||||
const CRYP_MARGIN = COMBAT.crypMargin();
|
||||
const TEXT_MARGIN = COMBAT.textMargin();
|
||||
|
||||
const statBarDimensions = (team, iter, margin) => {
|
||||
const statBarWidth = COMBAT.width() * 0.07;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user