Game Development Reference
In-Depth Information
Figure 6-1. Component overview
Particles
Every particle in the system needs to have at least a position and a velocity. Other properties can be
added as needed; and may include, for example, the following:
color
image
alpha
age
mass
The update method of the particle updates its values for a single time step.
function Particle(position){
this.position = position;
this.velocity = new Vec2(0.0, 0.0);
}
Particle.prototype = {
update: function(td) {
 
Search WWH ::




Custom Search