Sigo teniendo problemas... Tengo esta función:
Código PHP:
var ParticleSystem=new Array();
ParticleSystem.prototype.gravity=0;
ParticleSystem.prototype.wind=0;
ParticleSystem.prototype.moveParticles=function(){
for(var i=0;i<this.length;++i){
if (this[i].age<this[i].maxAge){
this[i].x+=this[i].speed*(Math.cos(this[i].angle*(Math.PI/180)))+this.wind*this[i].age;
this[i].y+=this[i].speed*(Math.sin(this[i].angle*(Math.PI/180)))+this.gravity*this[i].age;
this[i].age++;
}
else this.splice(i,1);
}
}
Sin embargo, parece que lo hago mal desde la declaración, ya que la consola de Javascript me lanza este error:
Cita: Uncaught TypeError: Cannot set property 'gravity' of undefined
¿Me pueden dar una ayuda con esta misión?