Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <reference path='../bower_components/phaser-official/build/phaser.d.ts' />
- /// <reference path='boot.ts' />
- /// <reference path='preloader.ts' />
- /// <reference path='sector.ts' />
- module SlashSystem {
- export class Game extends Phaser.Game {
- static screen: string = 'small';
- static srx: number = Math.max(window.innerWidth,window.innerHeight);
- static sry: number = Math.min(window.innerWidth,window.innerHeight);
- static logicWidth = window.innerWidth;
- static logicHeight = window.innerHeight;
- static r = Game.logicWidth / Game.logicHeight;
- static gameWidth: number;
- static gameHeight: number;
- static viewX: number;
- static viewY: number;
- static viewWidth: number;
- static viewHeight: number;
- static calcSize() {
- if (Game.srx >= 360){
- Game.screen = 'small';
- Game.gameWidth = 360;
- }
- if (Game.srx >= 480){
- Game.screen = 'normal';
- Game.gameWidth = 480;
- }
- if (Game.srx >= 720){
- Game.screen = "large";
- Game.gameWidth = 720;
- }
- if (Game.srx >= 940){
- Game.screen = "xlarge";
- Game.gameWidth = 1024;
- }
- if (Game.srx >= 1200){
- Game.screen = "xxlarge";
- Game.gameWidth = 2048;
- }
- var device = new Phaser.Device(<any>null);
- if (device.desktop){
- Game.screen = "xxlarge";
- Game.gameWidth = window.innerWidth;
- }
- device = null;
- Game.gameHeight = Game.gameWidth / Game.r;
- }
- static convertWidth (value) {
- return value / Game.logicWidth * Game.gameWidth;
- }
- static convertHeight (value) {
- return value / Game.logicHeight * Game.gameHeight;
- }
- bFontsReady: boolean = false;
- constructor() {
- super(Game.gameWidth, Game.gameHeight, Phaser.CANVAS, 'game', null);
- //this.input.addPointer();
- this.state.add('boot', Boot, false);
- this.state.add('preloader', Preloader, false);
- this.state.add('sector', Sector, false);
- this.state.start('boot');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement