예제 #1
0
 public Button()
 {
     var mesh = Game.Current.GetMesh("Torus");
     Add(new MeshStaticPart(mesh));
     Add(new MeshStaticPart(Game.Current.GetMesh("Cylinder")));
     Add(_Collider = new ObbTranslatedCollider(mesh));
 }
예제 #2
0
 public Spring()
 {
     var mesh = Game.Current.GetMesh("Spring");
     Add(new MeshStaticPart(mesh));
     Add(_Top = new MeshTranslatedScaledPart(Game.Current.NewMesh("WallRounded"), _CoverTranslation, _CoverScaleFactor) { Color = Color.FromArgb(123, 123, 123) });
     Add(_Bottom = new MeshTranslatedScaledPart(Game.Current.NewMesh("WallRounded"), -_CoverTranslation, _CoverScaleFactor) { Color = Color.FromArgb(0, 0, 0) });
     Add(_Collider = new ObbTranslatedCollider(mesh));
 }
예제 #3
0
        public Button()
        {
            var mesh = Game.Current.GetMesh("Torus");

            Add(new MeshStaticPart(mesh));
            Add(new MeshStaticPart(Game.Current.GetMesh("Cylinder")));
            Add(_Collider = new ObbTranslatedCollider(mesh));
        }
예제 #4
0
        public Spring()
        {
            var mesh = Game.Current.GetMesh("Spring");

            Add(new MeshStaticPart(mesh));
            Add(_Top = new MeshTranslatedScaledPart(Game.Current.NewMesh("WallRounded"), _CoverTranslation, _CoverScaleFactor)
            {
                Color = Color.FromArgb(123, 123, 123)
            });
            Add(_Bottom = new MeshTranslatedScaledPart(Game.Current.NewMesh("WallRounded"), -_CoverTranslation, _CoverScaleFactor)
            {
                Color = Color.FromArgb(0, 0, 0)
            });
            Add(_Collider = new ObbTranslatedCollider(mesh));
        }
예제 #5
0
 public Magnet()
 {
     var mesh = Game.Current.GetMesh("Magnet");
     Add(new MeshStaticPart(mesh));
     Add(_Collider = new ObbTranslatedCollider(mesh));
     Add(_Spark = new IndependentParticlePart()
     {
         Translation = new Vector3(0, 0, -4),
         Sound = Game.Current.GetSound("Magnet.wav", EffectVolume),
         Animation = new AnimatedQuad()
         {
             Texture = Game.Current.GetParticle("SparksFinal.png"),
             FrameSize = new Size(256, 256),
             FirstFrame = 0,
             CurrentFrame = 0,
             FrameRate = 30,
             TotalFrames = 10,
         },
         Size = new Vector2(25, 15),
     });
 }
예제 #6
0
        public Magnet()
        {
            var mesh = Game.Current.GetMesh("Magnet");

            Add(new MeshStaticPart(mesh));
            Add(_Collider = new ObbTranslatedCollider(mesh));
            Add(_Spark    = new IndependentParticlePart()
            {
                Translation = new Vector3(0, 0, -4),
                Sound       = Game.Current.GetSound("Magnet.wav", EffectVolume),
                Animation   = new AnimatedQuad()
                {
                    Texture      = Game.Current.GetParticle("SparksFinal.png"),
                    FrameSize    = new Size(256, 256),
                    FirstFrame   = 0,
                    CurrentFrame = 0,
                    FrameRate    = 30,
                    TotalFrames  = 10,
                },
                Size = new Vector2(25, 15),
            });
        }