public GameOverState(IStateManager stateManager) : base(stateManager) { _roomName = new SpectrumFont(StateManager.Game.ContentManager.LoadTexture("font.png")); _gameOver = new SpectrumFont(StateManager.Game.ContentManager.LoadTexture("font.png")); _pedastal = new SpriteSheet(StateManager.Game.ContentManager.LoadTexture("16x16.png")); _willy = new SpriteSheet(StateManager.Game.ContentManager.LoadTexture("16x16.png")); _boot = new SpriteSheet(StateManager.Game.ContentManager.LoadTexture("16x16.png")); _air = StateManager.Game.ContentManager.LoadImage("titleair.bmp"); }
public PauseState(IStateManager stateManager) : base(stateManager) { _paused = new SpectrumFont(StateManager.Game.ContentManager.LoadTexture("font.png")); _pressKey = new SpectrumFont(StateManager.Game.ContentManager.LoadTexture("font.png")); _paused.Text = $"`{FontColor.Cyan}- P A U S E D -"; _pressKey.Text = $"`{FontColor.Yellow}Press 'P' to resume"; _pause = new KeyUp(Keys.P); _pause.KeyReleased += (o, e) => StateManager.ChangeState("game", _roomId, false); }
public TitleScreenState(IStateManager stateManager) : base(stateManager) { _background = StateManager.Game.ContentManager.LoadImage("background.png"); _background2 = StateManager.Game.ContentManager.LoadImage("bgfill1.bmp"); _background3 = StateManager.Game.ContentManager.LoadImage("bgfill2.bmp"); _sun = StateManager.Game.ContentManager.LoadImage("sun.png"); _air = StateManager.Game.ContentManager.LoadImage("titleair.bmp"); _piano = StateManager.Game.ContentManager.LoadImage("piano.bmp"); _font = new SpectrumFont(StateManager.Game.ContentManager.LoadTexture("font.png")); _font.Text = " . . . . . . . . . . MANIC MINER . . BUG-BYTE ltd. 1983 . . By Matthew Smith . . . Q to P = Left & Right . . Bottom row = Jump . . A to G = Pause . . H to L = Tune On/Off . . . Guide Miner Willy through 20 lethal caverns . . . . . . . . "; _minScrollPos = _font.Text.Length * -8; }
public GameState(IStateManager stateManager) : base(stateManager) { var blocks = StateManager.Game.ContentManager.LoadTexture("blocks.png"); var sun = StateManager.Game.ContentManager.LoadTexture("sun.png"); var background = StateManager.Game.ContentManager.LoadTexture("background.png"); var sixteen = StateManager.Game.ContentManager.LoadTexture("16x16.png"); var airMeter = new Texture2D(stateManager.Game.GraphicsDevice, 256, 4); airMeter.Fill(Color.White); _pickUpKey = StateManager.Game.ContentManager.LoadSfx("pick.wav"); _die = StateManager.Game.ContentManager.LoadSfx("die.wav"); _jump = StateManager.Game.ContentManager.LoadSfx("jump.wav"); _font = new SpectrumFont(StateManager.Game.ContentManager.LoadTexture("font.png")); _roomRenderer = new RoomBlocks(blocks, background, sun); _air = StateManager.Game.ContentManager.LoadImage("titleair.bmp"); _lives = new LivesIndicator(sixteen); _baddieRenderer = new BaddieRenderer(sixteen); _willy = new MinerWillyRenderer(sixteen, background); _exit = new ExitRenderer(sixteen); _airMeter = new AirRenderer(airMeter); _scoreRenderer = new ScoreRenderer(StateManager.Game.ContentManager.LoadTexture("font.png")); _pauseables.Add(_willy); _pauseables.Add(_baddieRenderer); _pauseables.Add(_roomRenderer); _pauseables.Add(_exit); var blackBackground = new Texture2D(StateManager.Game.GraphicsDevice, 128, 24); blackBackground.Fill(Color.Black); _quitGameRenderer = new QuitGame(StateManager.Game.ContentManager.LoadTexture("font.png"), blackBackground); _quitGameRenderer.Hidden = true; _willy.IncrementScore += Score_Update; _willy.Jumping += Willy_Jumping; _willy.OnDeath += Willy_Death; _pauseKey = new KeyUp(Keys.P, () => { StateManager.ChangeState("paused", _roomId); }); _quitKey = new KeyUp(Keys.Escape, () => { ToggleQuit(!_quitShowing); }); _yesKey = new KeyUp(Keys.Y, () => { ToggleQuit(false); StateManager.ChangeState("title"); }); _noKey = new KeyUp(Keys.N, () => { ToggleQuit(false); }); }