public OptionsMenuState(ContentManager newManager)
        {
            IsUpdateable = true;

            contentManager = newManager;
            gameInput = new GameInput(Game1.graphics.GraphicsDevice);

            selectedMenuItem = 0;
            menuList = new List<OptionsMenuOption>(10);

            menuList.Add(new OptionsMenuOption("Starting Health"));
            menuList.Add(new OptionsMenuOption("Mute Music"));
            menuList.Add(new OptionsMenuOption("Show Timer"));
        }
        public LevelSelectMenuState(ContentManager newManager)
        {
            IsUpdateable = true;

            contentManager = newManager;
            gameInput = new GameInput(Game1.graphics.GraphicsDevice);

            selectedMenuItem = 0;
            menuList = new List<LevelSelectMenuOption>(5);
            for (int i = 0; i < 5; i++)
            {
                menuList.Add(new LevelSelectMenuOption());
            }
        }
        public SplashScreenState(ContentManager newManager)
        {
            contentManager = newManager;

            IsUpdateable = true;

            calledLoadAssets = false;
            flashOffText = false;

            startButtonDown = false;

            state = SplashScreenVisualState.Loading;
            fadeState = FadeState.FadeIn;
            fadeTimer = 0;

            gameInput = new GameInput(Game1.graphics.GraphicsDevice);
        }
        public BetaMenuState(ContentManager newManager)
        {
            IsUpdateable = true;

            contentManager = newManager;

            gameInput = new GameInput(Game1.graphics.GraphicsDevice);

            levelList = new List<LevelMenuOption>();

            musicPlaying = false;

            levelList.Add(new LevelMenuOption("testMap1"));
            levelList.Add(new LevelMenuOption("testMap2"));
            levelList.Add(new LevelMenuOption("climbTest"));
            levelList.Add(new LevelMenuOption("theLab"));
            levelList.Add(new LevelMenuOption("theLab2"));
            levelList.Add(new LevelMenuOption("WillysMap"));
        }
        public TitleScreenMenuState(ContentManager newManager, bool musicAlreadyPlaying, bool fade)
        {
            IsUpdateable = true;

            contentManager = newManager;

            gameInput = new GameInput(Game1.graphics.GraphicsDevice);

            musicPlaying = musicAlreadyPlaying;

            menuList = new List<TitleMenuOption>(5);
            menuList.Add(new TitleMenuOption("BEGIN"));
            menuList.Add(new TitleMenuOption("CONTINUE"));
            menuList.Add(new TitleMenuOption("OPTION"));
            menuList.Add(new TitleMenuOption("EXIT"));

            selectedMenuItem = 0;

            timePassed = 0;
            fadingOut = false;

            elapsedScreenTime = 0;

            MediaPlayer.Volume = 1.0f;

            magnetWopleyAnim = "playerWalkRight";
            magnetWopleyFrame = 0;
            magnetWopleyLastUpdateTime = 0;

            switch (Game1.gameRandom.Next() % 3)
            {
                case 0:
                    enemyFrameAnim = "angrySawWalkLeft";
                    break;
                case 1:
                    enemyFrameAnim = "lolrusWalkRight";
                    break;
                case 2:
                    enemyFrameAnim = "goombaWalkRight";
                    break;
            }
            enemyChaseFrame = 0;
            enemyFrameLastUpdateTime = 0;

            for (int i = 0; i < grassTiles.Length; i++)
            {
                grassTiles[i] = Game1.gameRandom.Next() % numberOfGrassTypes;
            }

            if (musicAlreadyPlaying)
            {
                showPressButtonDialog = false;
            }
            else
            {
                showPressButtonDialog = true;
                GameInput.LockMostRecentPad = false;
            }

            if (!fade)
            {
                Game1.diamondWipe.Parameters["time"].SetValue(1.0f);
                timePassed = 1001;
            }
            else
            {
                Game1.diamondWipe.Parameters["time"].SetValue(0.0f);
            }

            Game1.CurrentLevel = 0;
        }
        public LevelState(ContentManager newManager, string levelNameString)
        {
            EndLevelFlag = false;

            contentManager = newManager;

            gameInput = new GameInput(null);
            levelEntities = new List<Entity>(100);
            levelCamera = new Camera();
            levelBulletPool = new BulletPool();
            levelParticlePool = new ParticlePool(100);
            levelName = levelNameString;
            levelRecordTime = 0;

            paused = false;
            startButtonDown = false;

            showLevelCompleteText = false;

            loadingAnimTimePassed = 0;
            magnetWopleyFrame = 0;
            magnetWopleyLastUpdateTime = 0;
            chaserFrame = 0;
            chaserLastUpdateTime = 0;

            flags = new bool[flagNum];
            for (int i = 0; i < flagNum; i++)
            {
                flags[i] = false;
            }

            grabbed = false;
            new Thread(loadLevelThread).Start();

            Thread.Sleep(50);

            currentPlayerHealth = Game1.MagnetBoySaveData.defaultStartingHealth;

            fadingOut = false;
            fadingOutTimer = 0;

            IsUpdateable = true;

            MediaPlayer.Volume = 1.0f;

            GC.Collect();
        }
Beispiel #7
0
        /// <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()
        {
            gameRandom = new Random();

            base.Initialize();

            mapView = graphics.GraphicsDevice.Viewport.Bounds;

            currentLevel = 0;

            onScreenSaveSpin = 0;

            #if WINDOWS

            if (Game1.MagnetBoySaveData.loaded == false)
            {
                resetSaveData();
            }

            MediaPlayer.Volume = 1.0f;

            //FurthestLevelProgressed = 4;
            #endif
            #if XBOX
            resetSaveData();
            #endif

            gameInput = new GameInput(graphics.GraphicsDevice);
        }