public PauseCommand(GraphicsDevice graphics, HudObject hud, AudioManager audio, GraphicsDeviceManager gManager) { _graphics = graphics; this.audio = audio; _hud = hud; graphicsManager = gManager; }
public WinningGameState(GraphicsDevice graphicsDevice, HudObject hud, float mario_height, GraphicsDeviceManager gManager) : base(graphicsDevice) { this.hud = hud; // using 434 as the floor height jump_height = (434 - mario_height); graphicsManager = gManager; }
public PauseGameState(GraphicsDevice graphicsDevice, HudObject hud, AudioManager audio, GraphicsDeviceManager gManager) : base(graphicsDevice) { this.hud = hud; this.audio = audio; graphicsManager = gManager; CoC = new Vector2(graphics.Viewport.Width / 2, graphics.Viewport.Height / 2); }
public override void LoadContent(ContentManager content) { this.content = content; font = content.Load <SpriteFont>("temp_font"); hud = new HudObject(font); string name = "world_1_1_draft.txt"; //string name = "test_level.txt"; // figure out the file pathing later Tokenizer test = new Tokenizer(name, content); //gameObjects = gameObjects.Concat(test.GetSprites()).ToList(); layers[1].Objects = test.GetSprites(); layers[0].Objects.Add(new BGObject(content)); //layers[2].Objects.Add(hud); foreach (AbsObject temp in layers[1].Objects) { if (temp is MarioObject) { avatar = (MarioObject)temp; } else if (temp is EnemyObject) { EnemyObject enemy = (EnemyObject)temp; enemy.Mario = avatar; } } avatar.hud = hud; hud.audio = avatar.audio; keyboard = new KeyboardController(); keyboard.moveCommandDict.Add(Keys.Up, new UpCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Up, new DownCommand(avatar)); keyboard.moveCommandDict.Add(Keys.W, new UpCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.W, new DownCommand(avatar)); keyboard.moveCommandDict.Add(Keys.Down, new DownCommand(avatar)); keyboard.moveCommandDict.Add(Keys.S, new DownCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Down, new UpCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.S, new UpCommand(avatar)); keyboard.moveCommandDict.Add(Keys.Left, new LeftCommand(avatar)); keyboard.moveCommandDict.Add(Keys.A, new LeftCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Left, new RightCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.A, new RightCommand(avatar)); keyboard.moveCommandDict.Add(Keys.Right, new RightCommand(avatar)); keyboard.moveCommandDict.Add(Keys.D, new RightCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Right, new LeftCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.D, new LeftCommand(avatar)); keyboard.commandDict.Add(Keys.Space, new ThrowFireballCommand(avatar)); keyboard.commandDict.Add(Keys.Y, new StandardCommand(avatar)); keyboard.commandDict.Add(Keys.U, new SuperCommand(avatar)); keyboard.commandDict.Add(Keys.I, new FireCommand(avatar)); keyboard.commandDict.Add(Keys.O, new TakeDamageCommand(avatar)); keyboard.commandDict.Add(Keys.Q, new QuitCommand()); keyboard.commandDict.Add(Keys.P, new PauseCommand(graphics, hud, avatar.audio, graphicsManager)); keyboard.commandDict.Add(Keys.M, new MuteCommand(avatar.audio)); keyboard.commandDict.Add(Keys.Tab, new ThemeCommand(avatar.audio)); keyboard.commandDict.Add(Keys.R, new ResetCommand(graphics, graphicsManager, hud.audio)); gamepad = new GamepadController(); gamepad.moveCommandDict.Add(Buttons.A, new UpCommand(avatar)); gamepad.releaseCommandDict.Add(Buttons.A, new DownCommand(avatar)); gamepad.moveCommandDict.Add(Buttons.DPadDown, new DownCommand(avatar)); gamepad.releaseCommandDict.Add(Buttons.DPadDown, new UpCommand(avatar)); gamepad.moveCommandDict.Add(Buttons.DPadLeft, new LeftCommand(avatar)); gamepad.releaseCommandDict.Add(Buttons.DPadLeft, new RightCommand(avatar)); gamepad.moveCommandDict.Add(Buttons.DPadRight, new RightCommand(avatar)); gamepad.releaseCommandDict.Add(Buttons.DPadRight, new LeftCommand(avatar)); gamepad.commandDict.Add(Buttons.B, new ThrowFireballCommand(avatar)); gamepad.commandDict.Add(Buttons.Start, new QuitCommand()); gamepad.commandDict.Add(Buttons.Back, new PauseCommand(graphics, hud, avatar.audio, graphicsManager)); controllers.Add(keyboard); controllers.Add(gamepad); }
public override void LoadContent(ContentManager content) { font = content.Load <SpriteFont>("temp_font"); hud = new HudObject(font); string name = "doodle_test.txt"; token = new Tokenizer(name, content); avatar = new DoodleObject(new Vector2(windowWidth / 2, 3450), content, token.audio); camera.LookAt(avatar.Position); generator = new Level_Generator(content, camera, avatar, token.audio); generator.Initialize(layers[1]); //collision requires everything to be in the same list, so the platforms need to be with the avatar //changing the level floor to be platforms instead of blocks, no need for a level definition. //tokenizer does something with the audio so leaving the token object around for now layers[1].Objects.Add(new PlatformObject(new Vector2(0, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(64, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(128, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(192, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(256, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(320, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(384, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(448, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(512, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(576, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(640, 3540), -1, content)); layers[1].Objects.Add(new PlatformObject(new Vector2(704, 3540), -1, content)); //layers[1].Objects.Add(new PlatformObject(new Vector2(0, 3400), new Vector2(windowWidth, 3400), -1, content)); // nvm try and keep avatar at the end of the list layers[1].Objects.Add(avatar); layers[0].Objects.Add(new VertBGObject(content)); avatar.hud = hud; hud.audio = avatar.audio; keyboard = new KeyboardController(); gamepad = new GamepadController(); keyboard.commandDict.Add(Keys.Z, new MainMenuCommand(graphics, graphicsManager)); controllers.Add(keyboard); controllers.Add(gamepad); keyboard.moveCommandDict.Add(Keys.Up, new UpCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Up, new DownCommand(avatar)); keyboard.moveCommandDict.Add(Keys.W, new UpCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.W, new DownCommand(avatar)); keyboard.moveCommandDict.Add(Keys.Down, new DownCommand(avatar)); keyboard.moveCommandDict.Add(Keys.S, new DownCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Down, new UpCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.S, new UpCommand(avatar)); keyboard.moveCommandDict.Add(Keys.Left, new LeftCommand(avatar)); keyboard.moveCommandDict.Add(Keys.A, new LeftCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Left, new RightCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.A, new RightCommand(avatar)); keyboard.moveCommandDict.Add(Keys.Right, new RightCommand(avatar)); keyboard.moveCommandDict.Add(Keys.D, new RightCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.Right, new LeftCommand(avatar)); keyboard.releaseCommandDict.Add(Keys.D, new LeftCommand(avatar)); keyboard.commandDict.Add(Keys.Y, new StandardCommand(avatar)); keyboard.commandDict.Add(Keys.U, new SuperCommand(avatar)); keyboard.commandDict.Add(Keys.I, new FireCommand(avatar)); keyboard.commandDict.Add(Keys.O, new TakeDamageCommand(avatar)); keyboard.commandDict.Add(Keys.Q, new QuitCommand()); keyboard.commandDict.Add(Keys.P, new PauseCommand(graphics, hud, avatar.audio, graphicsManager)); keyboard.commandDict.Add(Keys.M, new MuteCommand(avatar.audio)); keyboard.commandDict.Add(Keys.Tab, new ThemeCommand(avatar.audio)); keyboard.commandDict.Add(Keys.R, new ResetDJCommand(graphics, graphicsManager, hud.audio)); avatar.audio.PlaySound("doodleTheme"); }
public GameOverGameState(GraphicsDevice graphicsDevice, HudObject hud, GraphicsDeviceManager gManager) : base(graphicsDevice) { this.hud = hud; graphicsManager = gManager; }