Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Intergrating Facebook Instant Games


Will5
 Share

Recommended Posts

Hi all,

I'd like to upload my game Instant Games, however I've been having a hard time applying Facebook's code to Phaser; I end up with a black every time.

Let's say I have the following code:

    var game = new Phaser.Game(500, 500, Phaser.AUTO, null, {preload: preload, create: create, update: update});
    
    var sprite;
    
    function preload(){
        game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
        game.load.image('sprite', 'img/character.png');
    }
    function create(){
        game.add.sprite(0,0,'sprite');
    }
    function update(){
    }

How should I modify it to make it compatible with Instant Games?

I'd really appreciate it if anyone can help me with this as I'm new to Phaser.

Link to comment
Share on other sites

I checked his tutorials; unfortunately I'm still getting black screens when I upload my game.

I noticed he put the code below inside FBInstant.startGameAsync()

game = new Phaser.Game(gameWidth, gameOptions.gameHeight, Phaser.CANVAS);

If I do the same, the game won't even run anymore.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...