Ejemplo n.º 1
0
 private void CreateExplosion()
 {
     // Make an explosion of pixels on the particle system..
     ParticleCircleEmitter explosion = new ParticleCircleEmitter(particles, Color.Red, Color.Orange, 1, 2);
     explosion.X = emit.X; // location
     explosion.Y = emit.Y;
     explosion.Life = 3; // life of the explosion
     explosion.Frequency = 100000;
     explosion.LifeMin = 5;
     explosion.LifeMax = 20;
     explosion.LifeFullMin = 5;
     explosion.LifeFullMax = 5;
     explosion.SpeedMin = 8;
     explosion.SpeedMax = 20;
 }
Ejemplo n.º 2
0
 public void Dibujar(Burbuja burbuja)
 {
     Point posicion = APosicionVisual(new Point(burbuja.getPosicion().X, burbuja.getPosicion().Y + burbuja.getAlto()));
     if (burbuja.Estado == EstadoBurbuja.Estable)
     {
         if (burbuja is BurbujaConEnemigo)
         {
             IEnemigo enemigo = ((BurbujaConEnemigo)burbuja).Enemigo;
             if (enemigo is PersonajeTerrestre)
             {
                 PersonajeTerrestre r = (PersonajeTerrestre)enemigo;
                 r.setPosicion(burbuja.getPosicion());
                 Dibujar(r);
             }
         }
         bv.Position = posicion;
         screen.Blit(bv);
     }
     else
     {
         if (burbuja.Estado == EstadoBurbuja.Rev1)
         {
             bvr1.Position = posicion;
             screen.Blit(bvr1);
             ParticleCircleEmitter explosion = new ParticleCircleEmitter(particles, Color.Green, Color.YellowGreen, 1, 2);
             explosion.X = posicion.X+burbuja.getAncho()/2; // donde explotará
             explosion.Y = posicion.Y+burbuja.getAlto()/2;
             explosion.Life = 5;
             explosion.Frequency = 10000;
             explosion.LifeMin = 3;
             explosion.LifeMax = 7;
             explosion.LifeFullMin = 5;
             explosion.LifeFullMax = 5;
             explosion.SpeedMin = 8;
             explosion.SpeedMax = 20;
         }
         else
         {
             bvr2.Position = posicion;
             screen.Blit(bvr2);
         }
     }
 }