示例#1
0
 public Acelerator()
 {
     var mesh = Game.Current.NewMesh("WallTextured");
     Add(new MeshStaticPart(mesh) { Texture = Game.Current.GetMaterial("Acelerator.jpg") });
     Add(_Collider = new ObbCollider(mesh));
     Add(_Arrows = new TranslatedParticlePart()
     {
         Translation = new Vector3(0, 0, -4),
         Animation = new AnimatedQuad()
         {
             Texture = Game.Current.GetParticle("RedArrows.png"),
             FrameSize = new Size(512, 256),
             Size = new Vector2(8, 8),
             FirstFrame = 7,
             CurrentFrame = 7,
             FrameRate = 4,
             TotalFrames = 6,
         }
     });
     Add(_RedArrows = new TranslatedParticlePart()
     {
         Translation = new Vector3(0, 0, -4.1f),
         Sound = Game.Current.GetSound("Acelerator.wav", EffectVolume),
         Animation = new AnimatedQuad()
         {
             Texture = Game.Current.GetParticle("RedArrows.png"),
             FrameSize = new Size(512, 256),
             Size = new Vector2(8, 8),
             FirstFrame = 5,
             CurrentFrame = 5,
             FrameRate = 1,
             TotalFrames = 1,
         }
     });
 }
        public BlackHole()
        {
            var mesh = Game.Current.NewMesh("BallTextured");

            Add(new MeshStaticPart(mesh)
            {
                Texture = Game.Current.GetMaterial("BlackHole.jpg")
            });
            Add(new SphereCollider(mesh));
            _SoundEffect   = Game.Current.GetSound("BlackHole.wav", EffectVolume);
            Add(_StarStorm = new TranslatedParticlePart()
            {
                Translation = new Vector3(0, 0, -4),
                Animation   = new AnimatedQuad()
                {
                    Texture      = Game.Current.GetParticle("thunders.png"),
                    FrameSize    = new Size(256, 256),
                    Size         = new Vector2(25, 25),
                    FirstFrame   = 0,
                    CurrentFrame = 0,
                    FrameRate    = 15,
                    TotalFrames  = 16,
                }
            });
        }
示例#3
0
        public Cannon()
        {
            var bodyMesh = Game.Current.GetMesh("Cannon");

            _LoadColider = new ObbCollider()
            {
                Extents = _LoadColiderExtents,
                Color   = ItemPart.DefaultPartColor,
            };
            Add(_LoadColider as ItemPart);
            Add(new MeshStaticPart(bodyMesh));
            var bodyObb = TgcObb.computeFromAABB(bodyMesh.BoundingBox);
            var bodyE   = bodyObb.Extents;

            bodyObb.Extents = new Vector3(bodyE.X * _BodyObbScaleY, bodyE.Y, bodyE.Z * _BodyObbScaleY);
            Add(new HollowObbCollider(bodyObb, bodyObb.Position - bodyMesh.Position, _MinBorderScale, _MaxBorderScale));
            bodyObb.dispose();

            var baseMesh = Game.Current.GetMesh("CannonBase");
            var baseObb  = TgcObb.computeFromAABB(baseMesh.BoundingBox);
            var baseE    = baseObb.Extents;

            baseObb.Extents   = new Vector3(baseE.X, baseE.Y * _BaseObbScaleY, baseE.Z);
            Add(_Base         = new MeshUnRotatedPart(baseMesh));
            Add(_BaseCollider = new ObbTranslatedUnRotatedCollider(baseObb, _BaseObbTranslation));

            Add(_Smoke = new TranslatedParticlePart()
            {
                Translation = new Vector3(0, 33, -4),
                Sound       = Game.Current.GetSound("Cannon.wav", EffectVolume),
                Animation   = new AnimatedQuad()
                {
                    Texture      = Game.Current.GetParticle("ExplosionGrey.png"),
                    FrameSize    = new Size(146, 146),
                    Size         = new Vector2(25, 25),
                    FirstFrame   = 2,
                    CurrentFrame = 2,
                    FrameRate    = 15,
                    TotalFrames  = 47,
                }
            });
            RotationChanged += Cannon_RotationChanged;
            _ChargeSound     = Game.Current.GetSound("CannonCharge.wav", 0);
        }
示例#4
0
 public BlackHole()
 {
     var mesh = Game.Current.NewMesh("BallTextured");
     Add(new MeshStaticPart(mesh) { Texture = Game.Current.GetMaterial("BlackHole.jpg") });
     Add(new SphereCollider(mesh));
     _SoundEffect = Game.Current.GetSound("BlackHole.wav", EffectVolume);
     Add(_StarStorm = new TranslatedParticlePart()
     {
         Translation = new Vector3(0, 0, -4),
         Animation = new AnimatedQuad()
         {
             Texture = Game.Current.GetParticle("thunders.png"),
             FrameSize = new Size(256, 256),
             Size = new Vector2(25, 25),
             FirstFrame = 0,
             CurrentFrame = 0,
             FrameRate = 15,
             TotalFrames = 16,
         }
     });
 }
示例#5
0
        public Acelerator()
        {
            var mesh = Game.Current.NewMesh("WallTextured");

            Add(new MeshStaticPart(mesh)
            {
                Texture = Game.Current.GetMaterial("Acelerator.jpg")
            });
            Add(_Collider = new ObbCollider(mesh));
            Add(_Arrows   = new TranslatedParticlePart()
            {
                Translation = new Vector3(0, 0, -4),
                Animation   = new AnimatedQuad()
                {
                    Texture      = Game.Current.GetParticle("RedArrows.png"),
                    FrameSize    = new Size(512, 256),
                    Size         = new Vector2(8, 8),
                    FirstFrame   = 7,
                    CurrentFrame = 7,
                    FrameRate    = 4,
                    TotalFrames  = 6,
                }
            });
            Add(_RedArrows = new TranslatedParticlePart()
            {
                Translation = new Vector3(0, 0, -4.1f),
                Sound       = Game.Current.GetSound("Acelerator.wav", EffectVolume),
                Animation   = new AnimatedQuad()
                {
                    Texture      = Game.Current.GetParticle("RedArrows.png"),
                    FrameSize    = new Size(512, 256),
                    Size         = new Vector2(8, 8),
                    FirstFrame   = 5,
                    CurrentFrame = 5,
                    FrameRate    = 1,
                    TotalFrames  = 1,
                }
            });
        }
示例#6
0
        public Cannon()
        {
            var bodyMesh = Game.Current.GetMesh("Cannon");
            _LoadColider = new ObbCollider()
            {
                Extents = _LoadColiderExtents,
                Color = ItemPart.DefaultPartColor,
            };
            Add(_LoadColider as ItemPart);
            Add(new MeshStaticPart(bodyMesh));
            var bodyObb = TgcObb.computeFromAABB(bodyMesh.BoundingBox);
            var bodyE = bodyObb.Extents;
            bodyObb.Extents = new Vector3(bodyE.X * _BodyObbScaleY, bodyE.Y, bodyE.Z * _BodyObbScaleY);
            Add(new HollowObbCollider(bodyObb, bodyObb.Position - bodyMesh.Position, _MinBorderScale, _MaxBorderScale));
            bodyObb.dispose();

            var baseMesh = Game.Current.GetMesh("CannonBase");
            var baseObb = TgcObb.computeFromAABB(baseMesh.BoundingBox);
            var baseE = baseObb.Extents;
            baseObb.Extents = new Vector3(baseE.X, baseE.Y * _BaseObbScaleY, baseE.Z);
            Add(_Base = new MeshUnRotatedPart(baseMesh));
            Add(_BaseCollider = new ObbTranslatedUnRotatedCollider(baseObb, _BaseObbTranslation));

            Add(_Smoke = new TranslatedParticlePart()
            {
                Translation = new Vector3(0, 33, -4),
                Sound = Game.Current.GetSound("Cannon.wav", EffectVolume),
                Animation = new AnimatedQuad()
                {
                    Texture = Game.Current.GetParticle("ExplosionGrey.png"),
                    FrameSize = new Size(146, 146),
                    Size = new Vector2(25, 25),
                    FirstFrame = 2,
                    CurrentFrame = 2,
                    FrameRate = 15,
                    TotalFrames = 47,
                }
            });
            RotationChanged += Cannon_RotationChanged;
            _ChargeSound = Game.Current.GetSound("CannonCharge.wav", 0);
        }