This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScaleManager { | |
constructor(canvas, isMobile) { | |
this.canvas = canvas; | |
this.mobile = isMobile; | |
window.addEventListener('resize', () => { | |
this.resize(this.canvas); | |
if (this.mobile) { | |
if (window.innerWidth < window.innerHeight) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
// Phaser webpack config | |
const phaserModule = path.join(__dirname, './node_modules/phaser/'); | |
const phaser = path.join(phaserModule, 'build/custom/phaser-split.js'); | |
const pixi = path.join(phaserModule, 'build/custom/pixi.js'); | |
const p2 = path.join(phaserModule, 'build/custom/p2.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pipe extends Phaser.Sprite { | |
public giveScore: boolean = true; | |
constructor(game: Phaser.Game, x: number, y: number, key: string) { | |
super(game, x, y, key); | |
this.game.physics.enable(this, Phaser.Physics.ARCADE); | |
this.body.velocity.x = speed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cat { | |
public age: number = 0; | |
} | |
class CatManager { | |
private static instance: CatManager; | |
private catPool: Cat[] = []; | |
constructor() {} |