/// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
        public levelMenu(Game1 g, bool multi)
            : base(g)
        {
            this.multi = multi;
            if (multi)
            {
                pos = new Vector2(-Config.screenW * 4, Config.screenH * 2);
                backdrop = TextureManager.bParkPlayground;
            }
            else
            {
                pos = new Vector2(Config.screenW, Config.screenH * 2);
                backdrop = TextureManager.bParkPond;
            }

            c = Color.White;
            destination = pos;
            //elements[0].Selected = true;

            float dist = Config.screenW / 6;
            float offset = dist / 3;

            elements.Add(new LevelElement("Alley", TextureManager.blankTexture,
                new Vector2(dist - offset, 50), true, this, delegate() { }, "alley"));
            elements.Add(new LevelElement("Landing Strip", TextureManager.blankTexture,
                new Vector2(dist * 2 - offset, 50), true, this, delegate() { }, "airport"));
            elements.Add(new LevelElement("The Outskirts", TextureManager.blankTexture,
                new Vector2(dist * 3 - offset, 50), true, this, delegate() { }, "jungle"));
            elements.Add(new LevelElement("Ruined City", TextureManager.blankTexture,
                new Vector2(dist * 4 - offset, 50), true, this, delegate() { }, "city"));
            elements.Add(new LevelElement("Powerplant", TextureManager.blankTexture,
                new Vector2(dist * 5 - offset, 50), true, this, delegate() { }, "powerplant"));

            elements[0].Selected = true;
        }
 public BlankMenu(Game1 g)
     : base(g)
 {
     pos = new Vector2(0, Config.screenH);
     destination = pos;
     backdrop = TextureManager.bParkSky;
     c = Color.White;
 }
 public SingleMenu(Game1 g)
     : base(g)
 {
     pos = new Vector2(Config.screenW, Config.screenH);
     backdrop = TextureManager.blankTexture;
     elements.Add(new MenuElement("floop", null, new Vector2(
         0, Config.screenH / 3), true, this, delegate() { }));
     c = Color.Green;
     destination = pos;
     //elements[0].Selected = true;
 }
        public TitleMenu(Game1 g)
            : base(g)
        {
            pos = new Vector2(0, 0);
            destination = pos;
            backdrop = TextureManager.titleScreen;
            elements.Add(new MenuElement("press start", null, new Vector2(
                0, Config.screenH - GFont.height), false, this, null));
            c = Color.White;

            Init();
        }
 public MultiMenu(Game1 g)
     : base(g)
 {
     pos = new Vector2(-Config.screenW, Config.screenH * 2);
     backdrop = TextureManager.bParkBandStand;
     elements.Add(new MenuElement("press a to join", null, new Vector2(
         0, Config.screenH / 3), true, this, delegate() { }));
     elements.Add(new MenuElement("", null, new Vector2(
         0, (Config.screenH / 3) + (Config.screenH / 6)), true, this, delegate() { }));
     c = Color.White;
     destination = pos;
     //elements[0].Selected = true;
 }
        public static void Init(Game1 game)
        {
            g = game;
            TitleMenu tm = new TitleMenu(game);
            menus.Add("title", tm);
            menus.Add("blank", new BlankMenu(game));
            menus.Add("single-multi", new SingleMultiMenu(game));
            menus.Add("level", new levelMenu(game, false));
            menus.Add("multi", new MultiMenu(game));
            menus.Add("versus", new GametypeVsMenu(game));
            menus.Add("coop", new GametypeCoopMenu(game));
            menus.Add("multi-level", new levelMenu(game, true));
            menus.Add("options", new OptionsMenu(game));

            currentMenu = tm;
        }
        public OptionsMenu(Game1 g)
            : base(g)
        {
            pos = new Vector2(0, Config.screenH * 3);
            backdrop = TextureManager.bDirt;
            finger = TextureManager.finger;

            elements.Add(new MenuElement("resolution", null, GetPos(20, 5),
                true, this, delegate() { }));
            elements.Add(new MenuElement("something", null, GetPos(25, 17),
                true, this, delegate() { }));

            elements.Add(new MenuElement("full screen", null, GetPos(20, 35),
                true, this, delegate() { }));
            elements.Add(new MenuElement(GetText(Config.fullScrn), null, GetPos(25, 47),
                true, this, delegate() { }));

            elements.Add(new MenuElement("music", null, GetPos(20, 65),
                true, this, delegate() { }));
            elements.Add(new MenuElement(GetText(SoundManager.musicOn), null, GetPos(25, 77),
                true, this, delegate() { }));

            elements.Add(new MenuElement("sound", null, GetPos(50, 65),
                true, this, delegate() { }));
            elements.Add(new MenuElement(GetText(SoundManager.soundOn), null, GetPos(55, 77),
                true, this, delegate() { }));

            destination = pos;
            elements[0].Selected = true;
            elements[0].lightColor = true;
            elements[2].lightColor = true;
            elements[4].lightColor = true;
            elements[6].lightColor = true;
            elements[1].color = new Color(230,230,230);
            elements[3].color = new Color(230, 230, 230);
            elements[5].color = new Color(230, 230, 230);
            elements[7].color = new Color(230, 230, 230);
            elements[1].Text = Config.realW + " X " + Config.realH;

            oldx = Config.realW;
            oldy = Config.realH;

            AddResolutions();
        }
        public SingleMultiMenu(Game1 g)
            : base(g)
        {
            pos = new Vector2(0, Config.screenH * 2);
            backdrop = TextureManager.bPark;
            elements.Add(new MenuElement("single player", null, new Vector2(
                0, Config.screenH / 3), true, this, delegate() { }));
            elements.Add(new MenuElement("multiplayer", null, new Vector2(
                0, (Config.screenH / 3) + (Config.screenH / 6) ), true, this, delegate() { }));

            kite = new Animator(TextureManager.kite, 1, 5);
            kite.AddAnimation("default", 0, 4, 10, true);
            kite.Play("default");

            font = new GFont(TextureManager.font, 4, 10);
            c = Color.White;
            destination = pos;
            elements[0].Selected = true;
        }
        public GametypeVsMenu(Game1 g)
            : base(g)
        {
            pos = new Vector2(-Config.screenW * 3, Config.screenH * 2);
            backdrop = TextureManager.bParkWildernessLeft;
            elements.Add(new MenuElement("competitive", null, new Vector2(
                10, 10), true, this, delegate() { }));
            c = Color.White;
            destination = pos;
            //elements[0].Selected = true;

            gameTypes.Add(new MenuElement("face off", null, new Vector2(
                 ((Config.screenW / 3) * 2) - ("face off".Length * GFont.width) - 10, ((Config.screenH / 20) * 4) + (Config.screenH / 10)),
                true, this, delegate() { MenuSystem.gameType = GameType.vsSurvival; }));
            gameTypes.Add(new MenuElement("theif", null, new Vector2(
                 ((Config.screenW / 3) * 2) - ("thief".Length * GFont.width) - 10, ((Config.screenH / 20) * 7) + (Config.screenH / 10)),
                true, this, delegate() { MenuSystem.gameType = GameType.thief; }));

            description = new MenuElement("", null, new Vector2((Config.screenW / 3) * 2 + (Config.screenW / 20), (Config.screenH / 20) * 7),
               false, this, delegate() { });
            description.SetToDescr();
            UpdateDescr();
        }
        public GametypeCoopMenu(Game1 g)
            : base(g)
        {
            pos = new Vector2(-Config.screenW*2, Config.screenH * 2);
            backdrop = TextureManager.bParkWildernessRight;
            elements.Add(new MenuElement("cooperative", null, new Vector2(
                Config.screenW - (GFont.width * "cooperative".Length) - 10, 10), true, this, delegate() { }));
            c = Color.White;
            destination = pos;
            //elements[0].Selected = true;

            gameTypes.Add(new MenuElement("survival", null, new Vector2(
                (Config.screenW / 3) + 10, ((Config.screenH / 20) * 4) + (Config.screenH / 10)),
                true, this, delegate() { MenuSystem.gameType = GameType.survival; }));
            gameTypes.Add(new MenuElement("hot potato", null, new Vector2(
                (Config.screenW / 3) + 10, ((Config.screenH / 20) * 7) + (Config.screenH / 10)),
                true, this, delegate() { MenuSystem.gameType = GameType.hotPotato; }));

            description = new MenuElement("", null, new Vector2(20, (Config.screenH / 20) * 7),
                false, this, delegate() { });
            description.SetToDescr();
            UpdateDescr();
        }
        public static void Init(Game1 g)
        {
            game = g;

            playerColors.Add(Color.Green);
            playerColors.Add(Color.Red);
            playerColors.Add(Color.Blue);
            playerColors.Add(Color.Yellow);

            highScore.Add("alley", 0);
            highScore.Add("airport", 0);
            highScore.Add("jungle", 0);
            highScore.Add("city", 0);
            highScore.Add("powerplant", 0);

            //xbox save
            #if XBOX
            xbox = true;
            #endif

            if (xbox)
            {
                result = StorageDevice.BeginShowSelector(PlayerIndex.One, new AsyncCallback(XboxLoadCallback), null);

                realW = 1920;
                realH = 1080;
            }
            else
            {
                PCLoad();
            }

            screenW = realW;
            screenH = (int)(Math.Round(realW / Aspect));
            screenR = screenW / 1920.0f;
            fontRatio = screenR;
        }
 public Menu(Game1 g)
 {
     game = g;
 }