mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 04:23:30 +00:00
23 lines
394 B
JavaScript
23 lines
394 B
JavaScript
|
|
||
|
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });
|
||
|
|
||
|
var p;
|
||
|
|
||
|
function preload() {
|
||
|
|
||
|
game.load.image('diamond', 'assets/sprites/diamond.png');
|
||
|
|
||
|
}
|
||
|
|
||
|
function create() {
|
||
|
|
||
|
game.stage.backgroundColor = '#337799';
|
||
|
|
||
|
p = game.add.emitter(game.world.centerX, 200, 200);
|
||
|
|
||
|
p.makeParticles('diamond');
|
||
|
|
||
|
p.start(false, 5000, 20);
|
||
|
|
||
|
}
|