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 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,21 @@ 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 = {
x: COMBAT.width() * 0.8, const LEAVE_HEIGHT = COMBAT.height() / 6;
y: COMBAT.height() * 0.8, const LEAVE_WIDTH = COMBAT.width() / 5;
width: COMBAT.width() * 0.15, const LEAVE_X = COMBAT.width() * 0.8;
height: COMBAT.height() * 0.1, const LEAVE_Y = COMBAT.height() * 0.9;
colour: [0.7, 0.2, 0],
glTag: 'leave', const menu = this.add
bText: 'Leave Game', .rectangle(LEAVE_X, LEAVE_Y, LEAVE_WIDTH, LEAVE_HEIGHT, 0x440000)
callback: leaveGame, .setInteractive()
}; .setOrigin(0)
this.box = this.add.existing(new Button(this, buttonProps)); .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() { cleanUp() {

View File

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