Merge branch 'master' of ssh://cryps.gg:40022/~/cryps

This commit is contained in:
Mashy 2019-03-05 14:57:42 +10:00
commit 26250d5b74

View File

@ -1,7 +1,7 @@
const Phaser = require('phaser'); const Phaser = require('phaser');
const { throttle } = require('lodash'); const { throttle } = require('lodash');
const { POSITIONS: { COMBAT }} = require('./constants'); const { TEXT, POSITIONS: { COMBAT }} = require('./constants');
const CombatLog = require('./combat.log'); const CombatLog = require('./combat.log');
const CombatCryps = require('./combat.cryps'); const CombatCryps = require('./combat.cryps');
const CombatSkills = require('./combat.skills'); const CombatSkills = require('./combat.skills');
@ -102,17 +102,20 @@ class Combat extends Phaser.Scene {
addLeaveGame() { addLeaveGame() {
const leaveGame = () => this.cleanUp(); const leaveGame = () => this.cleanUp();
this.input.keyboard.on('keydown_BACKSPACE', leaveGame, 0, this); this.input.keyboard.on('keydown_BACKSPACE', leaveGame, 0, this);
const buttonProps = { const LEAVE_HEIGHT = COMBAT.height() / 6;
x: COMBAT.width() * 0.8, const LEAVE_WIDTH = COMBAT.width() / 5;
y: COMBAT.height() * 0.8, const LEAVE_X = COMBAT.width() * 0.8;
width: COMBAT.width() * 0.15, const LEAVE_Y = COMBAT.height() * 0.9;
height: COMBAT.height() * 0.1,
colour: [0.7, 0.2, 0], const menu = this.add
glTag: 'leave', .rectangle(LEAVE_X, LEAVE_Y, LEAVE_WIDTH, LEAVE_HEIGHT, 0x440000)
bText: 'Leave Game', .setInteractive()
callback: leaveGame, .setOrigin(0)
}; .on('pointerdown', leaveGame);
// this.box = this.add.existing(new Button(this, buttonProps));
this.add
.text(menu.getCenter().x, menu.getCenter().y, 'Menu', TEXT.HEADER)
.setOrigin(0.5, 0.5);
} }
cleanUp() { cleanUp() {