Phaser Starter Snippets

Blank State
Description:this is a blank state template with the the essential functions
Example:var StateMain={ preload:function() { }, create:function() { }, update:function() { } }

switch states
Description:changes a state. For example if you game is over you can call game.state.start("StateGameOver");
Example:game.state.start("StateMain");

Start for desktop
Description:This is the main file needed to start a phaser game
Example:var game; window.onload = function() { game=new Phaser.Game(480,640,Phaser.AUTO,"ph_game"); game.state.add("StateMain",StateMain); game.state.start("StateMain"); }

Start for desktop/mobile
Description:start file need to start a phaser game with support for mobile
Example:This code has been updated. Details Here

Basic Html
Description:starter html file for Phaser
Example:

full screen meta tag
Description:meta tag to put html in full screen for mobile
Example:

Sample Init State
Description:Use this sample to make your own init state. Init states set up the bare bones code for launch and prepare for loading states
Example:

Sample Load State
Description:load states allow you preload everything before the game starts
Example: