bapho Posted November 25, 2015 Share Posted November 25, 2015 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 More sharing options...
shohan4556 Posted November 25, 2015 Share Posted November 25, 2015 This one may be helpful for you https://github.com/shohan4556/Phaser-Game-Dev-Template Link to comment Share on other sites More sharing options...
bapho Posted November 25, 2015 Author Share Posted November 25, 2015 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 More sharing options...
Recommended Posts