Adding in missing tests and fixing as we go

This commit is contained in:
Richard Davey
2013-05-31 19:28:16 +01:00
parent d510b785b1
commit 31c4d8cb14
30 changed files with 529 additions and 118 deletions
+14 -15
View File
@@ -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".
*/
+2 -1
View File
@@ -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;