phaser/examples/sprites/add a sprite.js
2013-10-22 03:58:20 +01:00

15 lines
386 B
JavaScript

var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });
function preload() {
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
function create() {
// This simply creates a sprite using the mushroom image we loaded above and positions it at 200 x 200
var test = game.add.sprite(200, 200, 'mushroom');
}