Source: particles/ambient/rain_particle.js

  1. import Particle from "../particle.js";
  2. class RainParticle extends Particle{
  3. /**
  4. * @constructor RainParticle
  5. * @param {float} x - The x coordinate of the position
  6. * @param {float} y - The y coordinate of the position
  7. * @param {float} life - The lifespan of the particle
  8. */
  9. constructor(x, y, life){
  10. super(x, y, life);
  11. this.mSpread = .3;
  12. }
  13. /**
  14. * @function update() - Uses the position and color control variables to update the particle based on the update interval
  15. */
  16. update(){
  17. super.update();
  18. }
  19. /**
  20. * @function hit() - the behavior of the rain particle when it collides with an object. Destroys the particle
  21. */
  22. hit(){
  23. this.terminate();
  24. }
  25. }
  26. export default RainParticle;