lapamplamouse Posted July 9, 2019 Share Posted July 9, 2019 I am trying to put all my phaser 3 games into one ionic 4 application. I found the following example which works perfectly for phaser 2 (https://store.enappd.com/product/ionic-phaser-game-framework-ionic-4/). however when I try to update to phaser three the screen goes blank. I imagine one of the problems is to do with how scenes have replaced states. does anyone have any ideas how to get around this or is this example workable anymore?? below is some code export class HomePage { constructor(private menuCtrl: MenuController) { game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, 'space- invaders', { preload: this.preload, create: this.create, update: this.update, render: this.render } ); that = Object.create(this.constructor.prototype); } preload() { this.load.image('bullet', 'assets/phaser/bullet.png'); game.load.image('enemyBullet', 'assets/phaser/enemy-bullet.png'); } } game.load works for phaser 2, if I use this.load in ionic it throws the following error ‘Property ‘load’ does not exist on type ‘HomePage’.’ With these changes to phaser is this method even possible?? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.