public InstructionsMenu(ContentManager content)
        {
            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font            = ResourceManager.getInstance().Font;
            buttonParms.Height          = 25;
            buttonParms.LinesTexture    = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour   = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX          = 560;
            buttonParms.Width           = 225;

            // return button
            buttonParms.StartY        = 557;
            buttonParms.Text          = "Return To Main Menu";
            buttonParms.TextsPosition = new Vector2(570f, buttonParms.StartY - 2);
            this.returnToMainButton   = new ColouredButton(buttonParms);

            // title
            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms.Position = new Vector2(0f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "Instructions");
            this.title           = new StaticDrawable2D(staticParms);

            // background
            staticParms.Position = new Vector2(80f, 25f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "HowToPlay");
            this.backGround      = new StaticDrawable2D(staticParms);

            // sound effects
            this.outroSfx = LoadingUtils.load <SoundEffect>(content, "WhereWeGonnaRob");
        }
        public MainMenu(ContentManager content)
        {
            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font            = ResourceManager.getInstance().Font;
            buttonParms.Height          = 25;
            buttonParms.LinesTexture    = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour   = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX          = 640;
            buttonParms.Width           = 150;

            // play button
            buttonParms.StartY        = 473;
            buttonParms.Text          = "Play";
            buttonParms.TextsPosition = new Vector2(690f, buttonParms.StartY - 2f);
            this.playButton           = new ColouredButton(buttonParms);

            // instructions button
            buttonParms.StartY        = 515;
            buttonParms.Text          = "Instructions";
            buttonParms.TextsPosition = new Vector2(650f, buttonParms.StartY - 2f);
            this.instructionsButton   = new ColouredButton(buttonParms);

            // exit button
            buttonParms.StartY        = 557;
            buttonParms.Text          = "Exit";
            buttonParms.TextsPosition = new Vector2(690f, buttonParms.StartY - 2);
            this.exitButton           = new ColouredButton(buttonParms);

            // title
            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms.Position = new Vector2(0f, -20f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "Title");
            this.title           = new StaticDrawable2D(staticParms);

            // background
            staticParms.Position = new Vector2(0f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "MainMenu");
            this.backGround      = new StaticDrawable2D(staticParms);

            // load sound effects
            this.introSfx    = LoadingUtils.load <SoundEffect>(content, "Introduction");
            this.outroSfx    = LoadingUtils.load <SoundEffect>(content, "LetsGo");
            this.idleSfxs    = new SoundEffect[3];
            this.idleSfxs[0] = LoadingUtils.load <SoundEffect>(content, "Rules");
            this.idleSfxs[1] = LoadingUtils.load <SoundEffect>(content, "HaventGotAllDay");
            this.idleSfxs[2] = LoadingUtils.load <SoundEffect>(content, "LetsRobSomething");
            // tired of hearing this when debugging and not starting in this state
            if (StateManager.getInstance().CurrentGameState == StateManager.GameState.MainMenu)
            {
                SoundManager.getInstance().sfxEngine.playSoundEffect(this.introSfx);
            }
#if WINDOWS
#if DEBUG
            ScriptManager.getInstance().registerObject(((ColouredButton)this.playButton).Text, "playText");
#endif
#endif
        }
        public MapSeletMenu(GraphicsDevice device, ContentManager content)
        {
            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font              = ResourceManager.getInstance().Font;
            buttonParms.Height            = 25;
            buttonParms.LinesTexture      = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour   = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour     = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX            = 580;
            buttonParms.Width             = 205;
            buttonParms.StartY            = 530;
            buttonParms.Text              = "Mode Selection";
            buttonParms.TextsPosition     = new Vector2(605f, buttonParms.StartY - 2);
            this.returnToModeSelectButton = new ColouredButton(buttonParms);

            // read in our map names from the Maps directory
            string[] maps = Directory.GetFiles(ResourceManager.MAP_FOLDER, "*.png");
            for (int i = 0; i < maps.Length; i++)
            {
                maps[i] = StringUtils.scrubPathAndExtFromFileName(maps[i]);
            }
            Array.Sort(maps, new MapComparer());

            // load up our map selections via the names from the dierctory
            this.mapSelections = new List <MapSelection>(maps.Length);
            for (int i = 0; i < maps.Length; i++)
            {
                // if the maps number is double digits we need to offset it a bit
                if (maps[i].Length == 4)
                {
                    this.mapSelections.Add(new MapSelection(device, maps[i], i, buttonParms.Width, buttonParms.Height, buttonParms.StartX, buttonParms.StartY));
                }
                else
                {
                    this.mapSelections.Add(new MapSelection(device, maps[i], i, buttonParms.Width, buttonParms.Height, buttonParms.StartX - 4, buttonParms.StartY));
                }
            }

            // title
            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms.Position = new Vector2(0f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "MapSelection");
            this.title           = new StaticDrawable2D(staticParms);

            // no preview image
            staticParms.Position    = new Vector2(20f, 100f);
            staticParms.Texture     = LoadingUtils.load <Texture2D>(content, "NoPreview");
            staticParms.Scale       = new Vector2(.8f, .8f);
            staticParms.LightColour = ResourceManager.TEXT_COLOUR;
            this.noPreviewImage     = new StaticDrawable2D(staticParms);
        }
Esempio n. 4
0
        public GameDisplay(ContentManager content)
        {
            this.content = content;
            this.timer   = new Timer(content);

            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font            = ResourceManager.getInstance().Font;
            buttonParms.Height          = 25;
            buttonParms.LinesTexture    = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour   = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX          = 700;
            buttonParms.Width           = 75;
            buttonParms.StartY          = 557;

            // start button
            buttonParms.Text          = "Start";
            buttonParms.TextsPosition = new Vector2(711f, buttonParms.StartY - 2f);
            this.startButton          = new ColouredButton(buttonParms);

            // HUD
            Text2DParams textParms = new Text2DParams();

            textParms.Font        = ResourceManager.getInstance().Font;
            textParms.LightColour = ResourceManager.TEXT_COLOUR;
            textParms.Position    = new Vector2(727f, 150f);
            this.treasureText     = new Text2D(textParms);

            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms          = new StaticDrawable2DParams();
            staticParms.Position = new Vector2(702f, 148f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "Treasure1");
            this.treasure        = new StaticDrawable2D(staticParms);

            //dust particle emitter
            BaseParticle2DEmitterParams particleEmitterParams = new BaseParticle2DEmitterParams();

            particleEmitterParams.ParticleTexture = LoadingUtils.load <Texture2D>(content, "Dust1");
            particleEmitterParams.SpawnDelay      = DustParticleEmitter.SPAWN_DELAY;
            this.dustEmitter = new DustParticleEmitter(particleEmitterParams);

            // load sound effects
            this.introSfx         = LoadingUtils.load <SoundEffect>(content, LEVEL_ENTRY_SFX_NAME);
            this.payDaySfx        = LoadingUtils.load <SoundEffect>(content, "PayDay");
            this.treasureSfx      = LoadingUtils.load <SoundEffect>(content, "TreasureCollect");
            this.guardDetectedSfx = LoadingUtils.load <SoundEffect>(content, "GuardDetection");
            this.dumpsterCrashSfx = LoadingUtils.load <SoundEffect>(content, "DumpsterCrash");
            this.dumpsterCloseSfx = LoadingUtils.load <SoundEffect>(content, "DumpsterClose");
        }
        public ModeSelectMenu(ContentManager content)
        {
            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font            = ResourceManager.getInstance().Font;
            buttonParms.Height          = 25;
            buttonParms.LinesTexture    = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour   = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX          = 560;
            buttonParms.Width           = 225;

            // Normal button
            buttonParms.StartY        = 473;
            buttonParms.Text          = "Normal";
            buttonParms.TextsPosition = new Vector2(640f, buttonParms.StartY - 2f);
            this.normalButton         = new ColouredButton(buttonParms);

            // Time attack button
            buttonParms.StartY        = 515;
            buttonParms.Text          = "Time Attack";
            buttonParms.TextsPosition = new Vector2(610f, buttonParms.StartY - 2f);
            this.timeAttackButton     = new ColouredButton(buttonParms);

            // return button
            buttonParms.StartY        = 557;
            buttonParms.Text          = "Return To Main Menu";
            buttonParms.TextsPosition = new Vector2(570f, buttonParms.StartY - 2);
            this.returnToMainButton   = new ColouredButton(buttonParms);

            // title
            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms.Position = new Vector2(0f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "ModeSelection");
            this.title           = new StaticDrawable2D(staticParms);

            // background
            staticParms.Position = new Vector2(15f, 150f);
            staticParms.Scale    = new Vector2(.75f, .75f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "ModeHelp");
            this.backGround      = new StaticDrawable2D(staticParms);

            // sound effects
            this.outroSfx = LoadingUtils.load <SoundEffect>(content, "WhereWeGonnaRob");
        }
        public GameOverMenu(ContentManager content, ScoreCalculationDelegate scoreCalculator, ResetBoardDelegate resetCallBack)
        {
            this.scoreCalculatorCallBack = (ScoreCalculationDelegate)scoreCalculator;
            this.resetCallBack           = resetCallBack;
            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font            = ResourceManager.getInstance().Font;
            buttonParms.Height          = 25;
            buttonParms.LinesTexture    = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour   = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX          = 580;
            buttonParms.Width           = 205;
            buttonParms.StartY          = 515;

            // replay button
            buttonParms.Text          = "Replay";
            buttonParms.TextsPosition = new Vector2(645f, buttonParms.StartY - 2f);
            this.replayButton         = new ColouredButton(buttonParms);

            // Map selection button
            buttonParms.StartY        = 557;
            buttonParms.Text          = "Map Selection";
            buttonParms.TextsPosition = new Vector2(610f, buttonParms.StartY - 2f);
            this.mapSelectionButton   = new ColouredButton(buttonParms);

            // game over text
            Text2DParams textParams = new Text2DParams();

            textParams.Font     = ResourceManager.getInstance().Font;
            textParams.Position = new Vector2(200f, 50f);
            this.gameOverText   = new Text2D(textParams);

            // loosing background
            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms.Position = new Vector2(-10f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "BackGround1");
            this.looseBackGround = new StaticDrawable2D(staticParms);

            // winning background
            staticParms.Texture = LoadingUtils.load <Texture2D>(content, "BackGround2");
            this.winBackGround  = new StaticDrawable2D(staticParms);
        }
        public InGameMenu(ContentManager content)
        {
            ColouredButtonParams buttonParms = new ColouredButtonParams();

            buttonParms.Font            = ResourceManager.getInstance().Font;
            buttonParms.Height          = 25;
            buttonParms.LinesTexture    = ResourceManager.getInstance().ButtonLineTexture;
            buttonParms.MouseOverColour = ResourceManager.MOUSE_OVER_COLOUR;
            buttonParms.RegularColour   = ResourceManager.TEXT_COLOUR;
            buttonParms.StartX          = 580;
            buttonParms.Width           = 205;

            // play button
            buttonParms.StartY        = 515;
            buttonParms.Text          = "Return to Game";
            buttonParms.TextsPosition = new Vector2(610f, buttonParms.StartY - 2f);
            this.returnToGameButton   = new ColouredButton(buttonParms);

            // exit button
            buttonParms.StartY        = 557;
            buttonParms.Text          = "Exit To Main Menu";
            buttonParms.TextsPosition = new Vector2(590f, buttonParms.StartY - 2);
            this.exitToMainButton     = new ColouredButton(buttonParms);

            // title
            StaticDrawable2DParams staticParms = new StaticDrawable2DParams();

            staticParms.Position = new Vector2(0f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "Paused");
            this.title           = new StaticDrawable2D(staticParms);

            // background
            staticParms.Position = new Vector2(-10f, 0f);
            staticParms.Texture  = LoadingUtils.load <Texture2D>(content, "InGameMenu");
            this.backGround      = new StaticDrawable2D(staticParms);

            // setup the particle emitter
            BaseParticle2DEmitterParams particleEmitterParams = new BaseParticle2DEmitterParams();

            particleEmitterParams.ParticleTexture = LoadingUtils.load <Texture2D>(content, "QuestionParticle");
            particleEmitterParams.SpawnDelay      = QuestionMarkEmitter.SPAWN_DELAY;
            this.particleEmitter = new QuestionMarkEmitter(particleEmitterParams);
        }