performance issue using arcade physics on mobile

Recommended Posts


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:D

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.add.sprite(0, 0, 'bg');
        this.ground = game.add.sprite(0, game.height - 112, 'ground');
        this.ground.body.immovable = true;
        this.player = game.add.sprite(,, 'flappy');
        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);


Share this post

Link to post
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.