Пример #1
0
 public Pawn(PawnColor color, PawnType type) : base("MasterMindPawn")
 {
     _effect = new Particle.ParticleSystem("light");
     _effect.SetLifeTime(10, 20);
     _effect.SetParent(this.EntityId);
     _effect.SetSize(0.2f, 0.2f);
     _effect.SetSpread(Helpers.PhysicsAndPositions.PI * 2);
     _effect.SetRandomSpeed(true, 0.05f);
     SetPawnColor(color);
     SetPawnType(type);
     SetTexture("pawn");
     Selected = false;
 }
Пример #2
0
 public Pawn(PawnColor color, PawnType type)
     : base("MasterMindPawn")
 {
     _effect = new Particle.ParticleSystem("light");
     _effect.SetLifeTime(10, 20);
     _effect.SetParent(this.EntityId);
     _effect.SetSize(0.2f, 0.2f);
     _effect.SetSpread(Helpers.PhysicsAndPositions.PI * 2);
     _effect.SetRandomSpeed(true, 0.05f);
     SetPawnColor(color);
     SetPawnType(type);
     SetTexture("pawn");
     Selected = false;
 }
Пример #3
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);
 }
Пример #4
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");
        }