remove webgl from combat

This commit is contained in:
ntr 2019-03-05 15:42:29 +11:00
parent 7e2e44fc57
commit 8f5a43219b
2 changed files with 17 additions and 13 deletions

View File

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

View File

@ -9,7 +9,7 @@ const Combat = require('./combat');
function renderCryps() {
const config = {
type: Phaser.AUTO,
type: Phaser.CANVAS,
// backgroundColor: '#181818',
resolution: window.devicePixelRatio,
scale: {