mirror of
https://github.com/wassname/phaser.git
synced 2026-07-20 12:30:48 +08:00
Fixed a fantastic FrameData bug. Also added support to the Emitter to handle multiple image keys and/or frames.
This commit is contained in:
+10
-6
@@ -15,6 +15,7 @@
|
||||
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
var p;
|
||||
var p2;
|
||||
|
||||
function preload() {
|
||||
|
||||
@@ -23,21 +24,27 @@
|
||||
game.load.image('diamond', 'assets/sprites/diamond.png');
|
||||
game.load.image('dude', 'assets/sprites/phaser-dude.png');
|
||||
game.load.image('coke', 'assets/sprites/cokecan.png');
|
||||
game.load.atlasJSONHash('pixies', 'assets/sprites/pixi_monsters.png', 'assets/sprites/pixi_monsters.json');
|
||||
game.load.spritesheet('balls', 'assets/sprites/balls.png', 17, 17);
|
||||
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
||||
p = new Phaser.Particles.Arcade.Emitter(game, 200, 100, 500);
|
||||
game.stage.backgroundColor = 0x337799;
|
||||
|
||||
p = game.add.emitter(200, 100, 50);
|
||||
|
||||
// p.width = 200;
|
||||
// p.height = 200;
|
||||
|
||||
p.makeParticles('diamond');
|
||||
// keys, frames, quantity, collide
|
||||
// p.makeParticles(['diamond', 'carrot', 'star']);
|
||||
p.makeParticles('balls', [0,1,2,3,4,5]);
|
||||
// p.makeParticles('pixies', [0,1,2,3]);
|
||||
|
||||
// Steady constant stream at 250ms delay and 10 seconds lifespan
|
||||
// p.start(false, 10000, 250, 100);
|
||||
|
||||
// p.start(true, 10000);
|
||||
|
||||
// explode, lifespan, frequency, quantity
|
||||
@@ -51,9 +58,6 @@
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
p.update();
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
Reference in New Issue
Block a user