Search the Community
Showing results for tags 'phaser.game'.
Hello, I just updated from Phaser 2.8.0 to 2.9.1 and I've got some complications that I don't know how to solve best. I'm using states in different js files with the object BasicGame to hold the states. In BasicGame.Play I create various items of a certain sprite class I wrote. Until now, I did it like this: var c = new x_collectible(this); So "this" is an instance of BasicGame.Play. With the new update, I got an error along the lines of "The value passed as the `game` argument ([object Object]) is not an instance of Phaser.Game.". I went ahead and tried to change it to: var c = new x_collectible(this.game); It worked, but now I'm having trouble accessing functions or variables of my BasicGame.Play state from within the collectible class. Before I used "this.game.variable" or "this.game.function()". What would be a proper solution to this? Adding BasicGame to the arguments when creating a collectible? Adding an isntance BasicGame as an attribute to my Phaser.Game and then do "this.game.BasicGame.Play.variable"? These don't really seem very practical to me...
I currently want to build a game for iPhone (I have a 5s) using Phaser and CocoonJS. I'm just wondering what the best/most optimized initial game size would be for this! aka for this code: var game = new Phaser.Game(800, 600, Phaser.AUTO, 'icicle-man');What would be the best options to replace 800 & 600 with? -Thanks
Hi there, I'm wondering, if it is valid/possible to set game width/height after game object initialization? What I'm trying to do is set actual game size in boot state when things such device is available. Unfortunately, it takes no effect on canvas, still the same dimension as once set at game object initialization phase. Any suggestion? Thanks!