mirror of
https://github.com/wassname/phaser.git
synced 2026-08-12 12:20:38 +08:00
Adding in missing tests and fixing as we go
This commit is contained in:
@@ -46,6 +46,10 @@ module Phaser {
|
||||
this._explode = true;
|
||||
this.on = false;
|
||||
|
||||
this.exists = true;
|
||||
this.active = true;
|
||||
this.visible = true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +77,11 @@ module Phaser {
|
||||
*/
|
||||
public alive: bool;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public active: bool;
|
||||
|
||||
/**
|
||||
* The minimum possible velocity of a particle.
|
||||
* The default value is (-100,-100).
|
||||
@@ -217,29 +226,14 @@ module Phaser {
|
||||
{
|
||||
/*
|
||||
randomFrame = this.game.math.random()*totalFrames;
|
||||
if(BakedRotations > 0)
|
||||
particle.loadRotatedGraphic(Graphics,BakedRotations,randomFrame);
|
||||
else
|
||||
{
|
||||
particle.loadGraphic(Graphics,true);
|
||||
particle.frame = randomFrame;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
if (BakedRotations > 0)
|
||||
particle.loadRotatedGraphic(Graphics,BakedRotations);
|
||||
else
|
||||
particle.loadGraphic(Graphics);
|
||||
*/
|
||||
|
||||
if (graphics)
|
||||
{
|
||||
particle.texture.loadImage(graphics);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (collide > 0)
|
||||
@@ -255,6 +249,8 @@ module Phaser {
|
||||
}
|
||||
|
||||
particle.exists = false;
|
||||
// Center the origin for rotation assistance
|
||||
particle.origin.setTo(particle.body.bounds.halfWidth, particle.body.bounds.halfHeight);
|
||||
|
||||
this.add(particle);
|
||||
|
||||
@@ -264,6 +260,9 @@ module Phaser {
|
||||
return this;
|
||||
}
|
||||
|
||||
public preUpdate() { }
|
||||
public postUpdate() { }
|
||||
|
||||
/**
|
||||
* Called automatically by the game loop, decides when to launch particles and when to "die".
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,7 @@ module Phaser {
|
||||
|
||||
super(game);
|
||||
|
||||
this.body.type = Types.BODY_DYNAMIC;
|
||||
this.lifespan = 0;
|
||||
this.friction = 500;
|
||||
|
||||
@@ -45,7 +46,7 @@ module Phaser {
|
||||
*/
|
||||
public update() {
|
||||
|
||||
//lifespan behavior
|
||||
// Lifespan behavior
|
||||
if (this.lifespan <= 0)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user