Jump to content

Sample usage for Phaser's Full Screen Mobile template


bapho
 Share

Recommended Posts

Hi,

 

As what the title says. Can anyone share a file with working code based on the Full Screen Mobile template from Phaser? I'm a little stumped at how to use it since all the game functions are within BasicGame.Game.prototype rather than what's demonstrated in the Phaser examples.

 

Right now I've figured out how to load a sprite up with something like:

BasicGame.Game.prototype = {  preload: function () {        this.game.load.image('bg01', 'images/bg-01.jpg');    this.game.load.image('char01', 'images/char-01-01.png');    },  create: function () {        //    Honestly, just about anything could go here. It's YOUR game after all. Eat your heart out!    var bg = this.add.sprite(0, 0, 'bg01');    var char = this.add.sprite(0, 0, 'char01');        }};

I'm using tern-phaser with Atom-ternjs, and it's not giving me any useful code completion hints, so yeah, this is going to be difficult to get a grasp on.

Link to comment
Share on other sites

Looks useful, thanks for the suggestion.

 

What confuses me though is what to put in those create() and update() functions in this case where they're in a .prototype. So I was hoping for some code samples where this sort of template is used since I can't rely on code completion to figure it out.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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