예제 #1
0
        /// <summary>
        /// Test textures
        /// </summary>
        public static void TestAnimatedTexture()
        {
            AnimatedTexture explosionTexture = null;
            TestGame.Start("TestAnimatedTexture",
                delegate
                {
                    explosionTexture = new AnimatedTexture("destroy");
                },
                delegate
                {
                    explosionTexture.Select((int)BaseGame.TotalTimeMs / 33);
                    int screenSize =
                        Math.Max(BaseGame.Width * 2 / 19, BaseGame.Height * 2 / 19);
                    explosionTexture.RenderOnScreen(new Rectangle(
                        BaseGame.Width / 2 - screenSize / 2,
                        BaseGame.Height / 2 - screenSize / 2,
                        screenSize, screenSize));

                    if (Input.MouseLeftButtonJustPressed)
                        Sound.Play(Sound.Sounds.Explosion);
                });
        }