Skip to content

Instantly share code, notes, and snippets.

@videlais
Created August 22, 2015 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/e6ae673296c6d24e9007 to your computer and use it in GitHub Desktop.
Save videlais/e6ae673296c6d24e9007 to your computer and use it in GitHub Desktop.
Phaser Group Basics - C
var game = new Phaser.Game(
200, //The width in pixels
200, //The height in pixels
Phaser.AUTO, //The render system
"phaser", //The element
{
preload: preload, // The preload function
create: create, // The create function
update: update // The update function
}
);
function preload() {}
function create() {
var sprite = game.add.sprite(
20, // The x position
20, // The y position
'sprite' // The image cache-key
);
var group = game.add.group(); // Create the group
group.add(sprite); // Add 'sprite' to the group
}
function update() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment