Пример #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,
         }
     });
 }
Пример #2
0
 public Menu()
 {
     Add(_Colider = new ObbCollider()
     {
         Color = Color.White
     });
     ItemRotation      = DefaultItemRotation;
     ItemRotationSpeed = DefaultItemRotationSpeed;
 }
Пример #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 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);
        }
Пример #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
 private Collision _ObbCollide(ObbCollider oc)
 {
     //TODO: Obb Collide Obb
     return null;
 }
Пример #7
0
 private Collision _ObbCollide(ObbCollider oc)
 {
     //TODO: Obb Collide Obb
     return(null);
 }
Пример #8
0
 public Menu()
 {
     Add(_Colider = new ObbCollider() { Color = Color.White });
     ItemRotation = DefaultItemRotation;
     ItemRotationSpeed = DefaultItemRotationSpeed;
 }