/// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            //RenderTarget2D target = new RenderTarget2D(GraphicsDevice, 1024, 576);
            //GraphicsDevice.SetRenderTarget(target);
            Text.loadContent(Content);
            Button.LoadContent(Content);
            MainMenu.loadContent(Content);
            MenuBoss.LoadContent(Content);
            //UpgradeMenu.loadContent(Content);

            PartyManager.Init();
            Resources.Init();
            SkillTree.LoadContent(Content);
            //SkillTree.Init();


            Character.load_content(Content);
            AnimatedEffect.LoadContent(Content);
            Status.LoadContent(Content);
            BattleManager.LoadContent(Content);
            SkillTree.LoadContent(Content);
            UpgradeMenu.loadContent(Content);
            LairManager.loadContent(Content);

            Menu_Song                   = Content.Load <SoundEffect>("Sounds/Epic_Loop");
            Menu_Song_Instance          = Menu_Song.CreateInstance();
            Menu_Song_Instance.IsLooped = true;
            Menu_Song_Instance.Volume   = .1f;

            Battle_Song                   = Content.Load <SoundEffect>("Sounds/VGameTune");
            Battle_Song_Instance          = Battle_Song.CreateInstance();
            Battle_Song_Instance.IsLooped = true;
            Battle_Song_Instance.Volume   = .1f;

            Main_Song                   = Content.Load <SoundEffect>("Sounds/LingeringChip");
            Main_Song_Instance          = Main_Song.CreateInstance();
            Main_Song_Instance.IsLooped = true;
            Main_Song_Instance.Volume   = .3f;
            //both songs have no duration

            EndGameText = new Text("And So,\n\nThrough much perserverence\nand a low interest mortgage\nour boss was finally\n\nLeft Alone.",
                                   new Vector2(300, 200), Text.fonts["6809Chargen-24"], Color.Cyan);
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        ///

        protected override void Initialize()
        {
            base.Initialize();
            //graphics.ToggleFullScreen();
            //graphics.ApplyChanges();

            IsMouseVisible    = true;
            this.Window.Title = "Leave Me Alone";

            MainMenu.init();
            PartyManager.Init();
            Resources.Init();

            Credits.Add("Leave Me Alone \n\nA game developed by: \n\n     Christopher Burkhalter\n     Kyle O'Donnell\n     Mitchell Smith");
            Credits.Add("Music (provided by Newgrounds):\n\nBattleSongLoop by Goukison\n~Epic_Loop~ by Catstuffer\nLingering \"Chip\" Puzzle by lacifer\n~Melancholious Victory by Blind-Bane\nVictory is Yours! by ImperfectDisciple");
            Credits.Add("Sound Effects provided by:\n\nhttp://www.freesfx.co.uk\nMitchell and Chris");
            Credits.Add("Thank You For Playing!");
        }
Example #3
0
        public static LeaveMeAlone.GameState Update(GameTime gameTime)
        {
            lastMouseState    = currentMouseState;
            currentMouseState = Mouse.GetState();
            if (menu_state == MenuState.main)
            {
                if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released)
                {
                    if (newGame.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        menu_state = MenuState.opening;
                    }
                    else if (loadGame.Intersects(currentMouseState.X, currentMouseState.Y) && !isNewGame)
                    {
                        LeaveMeAlone.Main_Song_Instance.Stop();
                        LeaveMeAlone.Menu_Song_Instance.Play();
                        return(LeaveMeAlone.GameState.Upgrade);
                    }
                    else if (quit.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        return(LeaveMeAlone.GameState.Quit);
                    }
                }
            }
            else if (menu_state == MenuState.opening)
            {
                if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released)
                {
                    if (next_intro.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        line_number++;
                        opening_timer = 0;
                    }
                    if (skip_intro.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        line_number = 1 + opening_monologue.Count();
                    }
                }
                if (line_number == 1 + opening_monologue.Count())
                {
                    menu_state = MenuState.boss;
                }
                else if (opening_timer > 300)
                {
                    if (line_number != opening_monologue.Count())
                    {
                        opening_timer = 0;
                    }
                    line_number++;
                }
                else
                {
                    opening_timer++;
                }
            }
            else
            {
                if (brute.Contains(new Vector2(currentMouseState.X, currentMouseState.Y)))
                {
                    bruteHover      = true;
                    mastermindHover = false;
                    operativeHover  = false;
                    brute.walk();
                    mastermind.idle();
                    operative.idle();
                    current = brute;
                }
                else if (mastermind.Contains(new Vector2(currentMouseState.X, currentMouseState.Y)))
                {
                    bruteHover      = false;
                    mastermindHover = true;
                    operativeHover  = false;
                    brute.idle();
                    mastermind.walk();
                    operative.idle();
                    current = mastermind;
                }
                else if (operative.Contains(new Vector2(currentMouseState.X, currentMouseState.Y)))
                {
                    bruteHover      = false;
                    mastermindHover = false;
                    operativeHover  = true;
                    brute.idle();
                    mastermind.idle();
                    operative.walk();
                    current = operative;
                }
                else
                {
                    current         = null;
                    bruteHover      = false;
                    mastermindHover = false;
                    operativeHover  = false;
                    brute.idle();
                    mastermind.idle();
                    operative.idle();
                }
                brute.Update(gameTime);
                mastermind.Update(gameTime);
                operative.Update(gameTime);
                if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released && canFinish)
                {
                    Vector2 mousePos = new Vector2(currentMouseState.X, currentMouseState.Y);
                    if (operative.Contains(mousePos) || brute.Contains(mousePos) || mastermind.Contains(mousePos))
                    {
                        BattleManager.boss = new Character(current.bossType, 1, new Vector2(BattleManager.bossLoc.X, BattleManager.bossLoc.Y));


                        BattleManager.heroes = PartyManager.CreateParty();

                        LeaveMeAlone.Main_Song_Instance.Stop();

                        UpgradeMenu.boughtRooms.Clear();
                        Resources.gold = 1000;
                        Resources.exp  = 0;
                        UpgradeMenu.Init(current);
                        LairManager.Init();
                        PartyManager.Init();
                        LairManager.EndOfGame   = false;
                        LairManager.TowerLevel  = 0;
                        LairManager.MaxLevel    = 3;
                        LairManager.LairRooms   = new List <Room>();
                        LairManager.boughtRooms = new List <UpgradeMenu.ButtonRoom>();

                        //return LeaveMeAlone.GameState.Upgrade;
                        return(LeaveMeAlone.GameState.Upgrade);
                    }
                }
                canFinish = true;
            }
            return(LeaveMeAlone.GameState.Main);
        }