Exemplo n.º 1
0
        public Rocket(ContentManager content, float x, float y, float width, float height, Vector2 movingDirection) : base(content, x, y, width, height)
        {
            textureTest                           = Game1.cManager.Load <Texture2D>("themes/" + Game1.world.currentTheme + "/items/rocket");
            this.travelSpeed                      = 15f;
            angle                                 = MapTools.VectorToAngle(movingDirection);
            particleEmitter                       = new RoundParticleEmitter(ParticleType.SPARK, new Vector2(0, 0));
            particleEmitter.pLifeTime             = 100;
            particleEmitter.pMinLifeTime          = 70;
            particleEmitter.pLoop                 = false;
            particleEmitter.pPerUpdate            = 100;
            particleEmitter.pSize                 = new Vector2(5, 5);
            particleEmitter.pVelocity             = 10;
            particleEmitter.pMinVelocity          = 5;
            particleEmitter.pIlluminationStrength = 1;
            particleEmitter.pBounceFactor         = 0.5f;
            particleEmitter.pDampenFactor         = 0.97f;
            particleEmitter.pGravityFactor        = 0.3f;

            smokeEmitter                       = new ConeParticleEmitter(ParticleType.ENGINE, new Vector2(0, 0), 0, 10);
            smokeEmitter.pLifeTime             = 40;
            smokeEmitter.pMinLifeTime          = 30;
            smokeEmitter.pLoop                 = false;
            smokeEmitter.pPerUpdate            = 1;
            smokeEmitter.pSize                 = new Vector2(15, 15);
            smokeEmitter.pVelocity             = 7;
            smokeEmitter.pMinVelocity          = 5;
            smokeEmitter.pIlluminationStrength = 0.0005f;
            smokeEmitter.pBounceFactor         = 0.0f;
            smokeEmitter.pDampenFactor         = 0.97f;
            smokeEmitter.pGravityFactor        = -0.02f;
            smokeEmitter.start();
            oldPos = pos;
        }
Exemplo n.º 2
0
 private void initParticles()
 {
     particleEmitter                       = new ConeParticleEmitter(ParticleType.SPARK, new Vector2(0, 0), new Vector2(0, 0), 30.0f);
     particleEmitter.pLifeTime             = 60;
     particleEmitter.pLoop                 = false;
     particleEmitter.pPerUpdate            = 1;
     particleEmitter.pSize                 = new Vector2(5, 5);
     particleEmitter.pVelocity             = 6;
     particleEmitter.pMinVelocity          = 5;
     particleEmitter.pIlluminationStrength = 1;
     particleEmitter.pBounceFactor         = 0.5f;
     particleEmitter.pDampenFactor         = 0.95f;
     particleEmitter.pGravityFactor        = 0.3f;
     particleEmitter.start();
 }