Exemple #1
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.Initialize(content);

            BlankNess n = new BlankNess();

            n.Initialize(Content);
            n.RaiseFlag(Jabber.Flags.FADE_IN);
            n.fullBlankity = 0.25f;
            Components.Add(n);

            if (gameplay.GetRemainingFox() == 0)
            {
                MenuObj logo = new MenuObj("ui/ui");
                logo.Initialize(Content);
                logo.CreateFramesFromXML("ui/ui_frames");
                logo.CurrentFrame = "cannonfire";
                logo.ResetDimensions();
                logo.UniformScale = ScaleFactor;
                logo.PosX         = 0.1f * BaseGame.Get.BackBufferWidth;

                logo.PosY   = 0.1f * BaseGame.Get.BackBufferHeight;
                logo.PosY  -= 0.1f * BaseGame.Get.BackBufferHeight;
                logo.Colour = Color.White * 0.5f;
                Components.Add(logo);
            }
            else
            {
                MenuObj logo = new MenuObj("ui/ui");
                logo.Initialize(Content);
                logo.CreateFramesFromXML("ui/ui_frames");
                logo.CurrentFrame = "chickenincannon";
                logo.ResetDimensions();
                logo.UniformScale = ScaleFactor;

                logo.Colour = Color.White * 0.5f;
                logo.PosY  -= 0.1f * BaseGame.Get.BackBufferHeight;
                Components.Add(logo);
            }

            ThinBlackLine b = new ThinBlackLine();

            b.Initialize(Content);
            Components.Add(b);

            Button restart = new FadeInButton();

            restart.Initialize(Content);
            restart.CreateFramesFromXML("ui/ui_frames");
            restart.CurrentFrame = "restart";
            restart.ResetDimensions();
            restart.Colour       = Color.LightGreen;
            restart.RegularScale = ScaleFactor / 2.0f;
            restart.ScaleOnHover = restart.RegularScale * 1.1f;
            restart.PosY         = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
            Components.Add(restart);

            if (gameplay.GetRemainingFox() == 0)
            {
                restart = new FadeInButton();
                restart.Initialize(Content);
                restart.CreateFramesFromXML("ui/ui_frames");
                restart.CurrentFrame = "doublearrow";
                restart.ResetDimensions();
                restart.Colour       = Color.LightBlue;
                restart.RegularScale = ScaleFactor / 2.0f;
                restart.ScaleOnHover = restart.RegularScale * 1.1f;
                restart.PosX         = BaseGame.Get.BackBufferWidth * 0.14f;
                restart.PosY         = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
                Components.Add(restart);
            }

            restart = new FadeInButton();
            restart.Initialize(Content);
            restart.CreateFramesFromXML("ui/ui_frames");
            restart.CurrentFrame = "quit";
            restart.ResetDimensions();
            restart.Colour       = Color.Red * 0.8f;
            restart.RegularScale = ScaleFactor / 2.0f;
            restart.ScaleOnHover = restart.RegularScale * 1.1f;
            restart.PosX         = -BaseGame.Get.BackBufferWidth * 0.14f;
            restart.PosY         = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
            Components.Add(restart);

            TextDrawer text = new TextDrawer("ui/LevelFont");

            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text         = "Best: " + ChicksnVixensGame.Get.GetLevelState(gameplay.location, gameplay.levelNum).Score;
            text.PosX         = 0 * BaseGame.Get.BackBufferWidth;
            text.PosY         = 0.1f * BaseGame.Get.BackBufferHeight;
            text.UniformScale = ScaleFactor * 0.7f;
            Components.Add(text);

            text        = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text         = "Score: " + gameplay.score.score.ToString();
            text.Colour       = Color.OrangeRed;
            text.UniformScale = ScaleFactor;
            text.PosX         = 0;
            text.PosY         = 0.175f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);

            StarDrawer s = new StarDrawer(gameplay.NumStars);

            s.Initialize(Content);
            Components.Add(s);

            Donut.Initialize(Content);
            Donut.CreateFramesFromXML("misc_frames");
            Donut.CurrentFrame = "donut";
            Donut.ResetDimensions();
            Donut.UniformScale = ScaleFactor;
            Donut.PosY         = -0.06f * BaseGame.Get.BackBufferHeight;
            Donut.Colour       = Color.White * 0.4f;
            Components.Add(Donut);


            text        = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text         = "Donuts: " + gameplay.donutScore.TargetScore;
            text.Colour       = Color.OrangeRed;
            text.UniformScale = ScaleFactor;
            text.PosX         = 0;
            text.PosY         = -0.025f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);

            text        = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text         = "Best: " + ChicksnVixensGame.Get.GetLevelState(gameplay.location, gameplay.levelNum).NumDonuts;
            text.UniformScale = ScaleFactor * 0.7f;
            text.PosX         = 0;
            text.PosY         = -0.1f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);
        }
Exemple #2
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.Initialize(content);

            BlankNess n = new BlankNess();
            n.Initialize(Content);
            n.RaiseFlag(Jabber.Flags.FADE_IN);
            n.fullBlankity = 0.25f;
            Components.Add(n);

            if (gameplay.GetRemainingFox() == 0)
            {
                MenuObj logo = new MenuObj("ui/ui");
                logo.Initialize(Content);
                logo.CreateFramesFromXML("ui/ui_frames");
                logo.CurrentFrame = "cannonfire";
                logo.ResetDimensions();
                logo.UniformScale = ScaleFactor;
                logo.PosX = 0.1f * BaseGame.Get.BackBufferWidth;

                logo.PosY = 0.1f * BaseGame.Get.BackBufferHeight;
                logo.PosY -= 0.1f * BaseGame.Get.BackBufferHeight;
                logo.Colour = Color.White * 0.5f;
                Components.Add(logo);
            }
            else
            {
                MenuObj logo = new MenuObj("ui/ui");
                logo.Initialize(Content);
                logo.CreateFramesFromXML("ui/ui_frames");
                logo.CurrentFrame = "chickenincannon";
                logo.ResetDimensions();
                logo.UniformScale = ScaleFactor;

                logo.Colour = Color.White * 0.5f;
                logo.PosY -= 0.1f * BaseGame.Get.BackBufferHeight;
                Components.Add(logo);
            }

            ThinBlackLine b = new ThinBlackLine();
            b.Initialize(Content);
            Components.Add(b);

            Button restart = new FadeInButton();
            restart.Initialize(Content);
            restart.CreateFramesFromXML("ui/ui_frames");
            restart.CurrentFrame = "restart";
            restart.ResetDimensions();
            restart.Colour = Color.LightGreen;
            restart.RegularScale = ScaleFactor / 2.0f;
            restart.ScaleOnHover = restart.RegularScale * 1.1f;
            restart.PosY = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
            Components.Add(restart);

            if (gameplay.GetRemainingFox() == 0)
            {
                restart = new FadeInButton();
                restart.Initialize(Content);
                restart.CreateFramesFromXML("ui/ui_frames");
                restart.CurrentFrame = "doublearrow";
                restart.ResetDimensions();
                restart.Colour = Color.LightBlue;
                restart.RegularScale = ScaleFactor / 2.0f;
                restart.ScaleOnHover = restart.RegularScale * 1.1f;
                restart.PosX = BaseGame.Get.BackBufferWidth * 0.14f;
                restart.PosY = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
                Components.Add(restart);
            }

            restart = new FadeInButton();
            restart.Initialize(Content);
            restart.CreateFramesFromXML("ui/ui_frames");
            restart.CurrentFrame = "quit";
            restart.ResetDimensions();
            restart.Colour = Color.Red * 0.8f;
            restart.RegularScale = ScaleFactor / 2.0f;
            restart.ScaleOnHover = restart.RegularScale * 1.1f;
            restart.PosX = -BaseGame.Get.BackBufferWidth * 0.14f;
            restart.PosY = -BaseGame.Get.HalfBackBufferHeight * 0.5f;
            Components.Add(restart);

            TextDrawer text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Best: " + ChicksnVixensGame.Get.GetLevelState(gameplay.location, gameplay.levelNum).Score;
            text.PosX = 0 * BaseGame.Get.BackBufferWidth;
            text.PosY = 0.1f * BaseGame.Get.BackBufferHeight;
            text.UniformScale = ScaleFactor * 0.7f;
            Components.Add(text);

            text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Score: " + gameplay.score.score.ToString();
            text.Colour = Color.OrangeRed;
            text.UniformScale = ScaleFactor;
            text.PosX = 0;
            text.PosY = 0.175f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);

            StarDrawer s = new StarDrawer(gameplay.NumStars);
            s.Initialize(Content);
            Components.Add(s);

            Donut.Initialize(Content);
            Donut.CreateFramesFromXML("misc_frames");
            Donut.CurrentFrame = "donut";
            Donut.ResetDimensions();
            Donut.UniformScale = ScaleFactor;
            Donut.PosY = -0.06f * BaseGame.Get.BackBufferHeight;
            Donut.Colour = Color.White * 0.4f;
            Components.Add(Donut);

            text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Donuts: " + gameplay.donutScore.TargetScore;
            text.Colour = Color.OrangeRed;
            text.UniformScale = ScaleFactor;
            text.PosX = 0;
            text.PosY = -0.025f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);

            text = new TextDrawer("ui/LevelFont");
            text.Handle = BaseSprite.SpriteHandle.CENTER;
            text.Initialize(Content);
            text.Text = "Best: " + ChicksnVixensGame.Get.GetLevelState(gameplay.location, gameplay.levelNum).NumDonuts;
            text.UniformScale = ScaleFactor * 0.7f;
            text.PosX = 0;
            text.PosY = -0.1f * BaseGame.Get.BackBufferHeight;
            Components.Add(text);
        }