Esempio n. 1
0
 public TimedCannon(float posx, float posy, int[] times)
 {
     _times = times.ToList();
     _color = new byte[3] {
         (byte)r.Next(255), (byte)r.Next(255), (byte)r.Next(255)
     };
     _pos = new PointFloat(posx, posy);
     _firePar.SetLifeTime(3, 6);
     _firePar.SetPhysics(false);
     _firePar.SetSpread(0.5f);
     _firePar.SetSize(0.1f, 0.1f);
     _firePar.SetRandomSpeed(true, 0.5f);
     _firePar.SetColor(255, 255, 100);
 }
Esempio n. 2
0
 public FlammingBall() : base()
 {
     Type = "Fball";
     EnableAirResistance(false);
     EnablePhysics(true);
     _fire.SetSpread(Helpers.PhysicsAndPositions.PI * 20.0f);
     _fire.SetLifeTime(20, 70);
     SetTexture(ResourceManager.GetTexture("ball"));
     Z_Index = 10;
     _fire.SetColor(0, 200, 0);
     _fire.SetParent(EntityId);
     _fire.SetPhysics(true);
     SetStaticObject(false);
     SetPhysSize(0.7f);
 }
Esempio n. 3
0
        public FireWork(PointFloat pos, byte[] color) : base("FireWork")
        {
            SetTexture("bullet");
            float velx = (float)(r.NextDouble() - 0.5);
            float vely = (float)(r.NextDouble()) + 3.0f;

            SetVelocity(velx / 10f, vely / 6.0f);
            EnablePhysics(false);
            SetStaticObject(false);
            SetSize(0.2f, 0.2f);
            SetPos(pos);
            _explosion.SetRandomSpeed(true, 0.01f);
            _explosion.SetSpread(Helpers.PhysicsAndPositions.PI * 2);
            _explosion.SetLifeTime(30, 100);
            _explosion.SetPhysics(false);
            _color = color;
            _smoke.SetSize(0.05f, 0.05f);
            _smoke.SetPhysics(false);
            _smoke.SetSpread(1f);
            SetRotationVelocity((float)r.Next(20, 60) / 100f);
            time = r.Next(50, 100);
            SoundPool.PlaySound("lauch");
        }