コード例 #1
0
 public SpaceShip() : base()
 {
     Type = "SpaceGame.SpaceShip";
     SetTexture(ResourceManager.GetTexture("spaceShip"));
     engineFirePar.SetLifeTime(10, 30);
     engineFirePar.SetRandomSpeed(true, 0.1f);
     gun.SetRandomSpeed(true, 0.1f);
     gun.SetLifeTime(30, 30);
     gun.SetSpread(0.1f);
     EnablePhysics(true);
     SetStaticObject(false);
     EnableAirResistance(true);
     SetPhysSize(0.5f);
     Z_Index = 5;
     //Lights.Light _light = new Lights.Light(255, 0, 255, EntityId);
     //TomatoMainEngine.AddGameObject(_light);
 }
コード例 #2
0
ファイル: Pawn.cs プロジェクト: rickwesselink/TomatoEngine
 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
ファイル: Pawn.cs プロジェクト: Vinic/TomatoEngine
 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;
 }
コード例 #4
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);
 }
コード例 #5
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);
 }
コード例 #6
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");
        }