• Content Count

  • Joined

  • Last visited

  1. Hello, I've tried to code a FlappyBird-clone in phaser but i have performance issues on mobile devices. When I run the game everything works fine but when the player falls (because of the gravity), it doesn't seem "smooth" anymore and the game lags. I've run the game on a LG G3 and a Sony Xperia Z. thanks in advance var game = new Phaser.Game(288, 512, Phaser.WEBGL); var mainState = { preload: function() { game.load.image('flappy' ,'img/flappy.png'); game.load.image('bg' ,'img/bg.png'); game.load.image('btn' ,'img/btn.png'); game.load.image('ground' ,'img/ground.png'); }, create: function() { game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.physics.startSystem(Phaser.Physics.ARCADE); = game.add.sprite(0, 0, 'bg'); this.ground = game.add.sprite(0, game.height - 112, 'ground'); game.physics.arcade.enableBody(this.ground); this.ground.body.immovable = true; this.player = game.add.sprite(,, 'flappy'); this.player.anchor.set(0.5); game.physics.arcade.enableBody(this.player); this.player.body.bounce.set(0.2); this.player.body.gravity.y = 500; game.input.onTap.add(this.jump, this); }, update: function() { game.physics.arcade.collide(this.player, this.ground); }, jump: function() { this.player.body.velocity.y = -200; } }; game.state.add('main', mainState); game.state.start('main');
  2. Hello, I've tried to make a "local multiplayer" game in which one player controlls one half of the display and the other player controlls the other half of the display. So I tried to get the x - coordinates from game.input.pointer1.x but it always returns -1. Does anybody have an idea how to get the x-coordinates ? (sorry for my bad englisch ^^)