/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
public KeyboardController(Game1 game, Mario mario) { time = 0; timeSinceToggle = 0; oldState = Keyboard.GetState(PlayerIndex.One); //action state keys keyBoardCommands.Add((int)Keys.Up, new UpCommand(mario)); keyBoardCommands.Add((int)Keys.W, new UpCommand(mario)); keyBoardCommands.Add((int)Keys.Down, new DownCommand(mario)); keyBoardCommands.Add((int)Keys.S, new DownCommand(mario)); keyBoardCommands.Add((int)Keys.Left, new LeftCommand(mario)); keyBoardCommands.Add((int)Keys.A, new LeftCommand(mario)); keyBoardCommands.Add((int)Keys.Right, new RightCommand(mario)); keyBoardCommands.Add((int)Keys.D, new RightCommand(mario)); keyBoardCommands.Add((int)Keys.Up & (int)Keys.Left, new UpLeftCommand(mario)); keyBoardCommands.Add((int)Keys.Space, new FireballCommand(mario)); keyBoardCommands.Add((int)Keys.F, new PlaceBlockCommand(game.Scene)); keyBoardCommands.Add((int)Keys.H, new DestroyBlockCommand(game.Scene)); //power up state keys keyBoardCommands.Add((int)Keys.Y, new StandardCommand(mario)); keyBoardCommands.Add((int)Keys.U, new SuperCommand(mario)); keyBoardCommands.Add((int)Keys.I, new FireCommand(mario)); keyBoardCommands.Add((int)Keys.O, new DeadCommand(mario)); //Game commands keyBoardCommands.Add((int)Keys.R, new ResetCommand(game)); keyBoardCommands.Add((int)Keys.P, new PauseCommand(game)); keyBoardCommands.Add((int)Keys.Q, new QuitCommand(game)); keyBoardCommands.Add((int)Keys.M, new MuteCommand(game)); keyBoardCommands.Add((int)Keys.V, new VictoryCommand(game)); keyBoardCommands.Add((int)Keys.G, new GameoverCommand(game)); }
public MarioFactory(Game1 game) { this.position.X = 0; this.position.Y = game.GraphicsDevice.Viewport.Height; this.texture = game.Content.Load<Texture2D>("mario_2"); sprites = new Dictionary<int,ISprite>(); }
public Mario(Game1 game, Scene scene) { MarioFactory = new MarioFactory(game); currentSprite = (MarioSprite)MarioFactory.MakeProduct(1); powerupStateFactor = 0; actionStateFactor = 1; direction = 1; idle = new MarioIdleState(this); jump = new MarioJumpingState(this); walk = new MarioWalkingState(this); crouch = new MarioCrouchingState(this); fall = new MarioFallingState(this); standard = new MarioStandard(this); super = new MarioSuper(this); fire = new MarioFire(this); dead = new MarioDead(this); powerupState = standard; currentState = idle; previousState = currentState; previousSprite = currentSprite; this.game = game; this.scene = scene; gravity = scene.Gravity; isGrounded = false; points = 0; coins = 10; lives = 3; sounds = new SoundMachine(game); }
public Mario(Game1 game, int posX, int posY) { MarioFactory = new MarioFactory(game); currentSprite = (MarioSprite)MarioFactory.MakeProduct(1); powerupStateFactor = 0; actionStateFactor = 1; direction = 1; idle = new MarioIdleState(this); jump = new MarioJumpingState(this); walk = new MarioWalkingState(this); crouch = new MarioCrouchingState(this); fall = new MarioFallingState(this); standard = new MarioStandard(this); super = new MarioSuper(this); fire = new MarioFire(this); dead = new MarioDead(this); powerupState = standard; currentState = idle; previousState = currentState; previousSprite = currentSprite; marioVec.X = posX; marioVec.Y = posY; }
public LevelManager(Game1 game) { this.game = game; texture = game.Content.Load<Texture2D>("LevelManager"); oldState = Keyboard.GetState(); font = game.Content.Load<SpriteFont>("LevelFonts"); choose = false; }
public Parser(Game1 game) { this.game = game; blockFactory = new BlockFactory(game); itemFactory = new ItemFactory(game); enemyFactory = new EnemyFactory(game); latestCheckpoint = new List<Vector2>(); }
public GamePadController(Game1 game, Mario mario) { oldState = GamePad.GetState(PlayerIndex.One); GamepadCommands.Add((int)Buttons.DPadUp, new UpCommand(mario)); GamepadCommands.Add((int)Buttons.DPadDown, new DownCommand(mario)); GamepadCommands.Add((int)Buttons.DPadLeft, new LeftCommand(mario)); GamepadCommands.Add((int)Buttons.DPadRight, new RightCommand(mario)); GamepadCommands.Add((int)Buttons.B, new FireballCommand(mario)); GamepadCommands.Add((int)Buttons.Start, new PauseCommand(game)); }
public SoundMachine(Game1 game) { soundFX = new Dictionary<String, SoundEffect>(); soundFX.Add("small-jump", game.Content.Load<SoundEffect>("jump-small")); soundFX.Add("big-jump", game.Content.Load<SoundEffect>("jump-super")); soundFX.Add("die", game.Content.Load<SoundEffect>("mariodie")); soundFX.Add("powerup", game.Content.Load<SoundEffect>("powerup")); soundFX.Add("stomp", game.Content.Load<SoundEffect>("stomp")); soundFX.Add("oneup", game.Content.Load<SoundEffect>("1-up")); soundFX.Add("bump", game.Content.Load<SoundEffect>("bump")); soundFX.Add("coin", game.Content.Load<SoundEffect>("coin")); soundFX.Add("powerdown", game.Content.Load<SoundEffect>("pipe")); soundFX.Add("gameover", game.Content.Load<SoundEffect>("GameOverSound")); soundFX.Add("warning", game.Content.Load<SoundEffect>("warning")); soundFX.Add("bricksmash", game.Content.Load<SoundEffect>("breakblock")); soundFX.Add("pause", game.Content.Load<SoundEffect>("pause")); soundFX.Add("winner", game.Content.Load<SoundEffect>("stage_clear")); }
public KeyboardController(Game1 game, Mario mario) { oldState = Keyboard.GetState(PlayerIndex.One); //action state keys keyBoardCommands.Add((int)Keys.Up, new UpCommand(mario)); keyBoardCommands.Add((int)Keys.W, new UpCommand(mario)); keyBoardCommands.Add((int)Keys.Down, new DownCommand(mario)); keyBoardCommands.Add((int)Keys.S, new DownCommand(mario)); keyBoardCommands.Add((int)Keys.Left, new LeftCommand(mario)); keyBoardCommands.Add((int)Keys.A, new LeftCommand(mario)); keyBoardCommands.Add((int)Keys.Right, new RightCommand(mario)); keyBoardCommands.Add((int)Keys.D, new RightCommand(mario)); keyBoardCommands.Add((int)Keys.Space, new FireballCommand(mario)); //power up state keys keyBoardCommands.Add((int)Keys.Y, new StandardCommand(mario)); keyBoardCommands.Add((int)Keys.U, new SuperCommand(mario)); keyBoardCommands.Add((int)Keys.I, new FireCommand(mario)); keyBoardCommands.Add((int)Keys.O, new DeadCommand(mario)); //block keys //reset command keyBoardCommands.Add((int)Keys.R, new ResetCommand(game)); keyBoardCommands.Add((int)Keys.P, new PauseCommand(game)); }
public Block(Game1 game, int posX, int posY) { BlockFactory = new BlockFactory(game); }
public Scene(Game1 game) { this.game = game; }
public StarMario(IMario decoratedMario, Game1 game) { this.decoratedMario = decoratedMario; theGame = game; MusicManager.Instance.SetBackgroundMusic("star-theme"); }
public BlockFactory(Game1 game) { this.texture = game.Content.Load<Texture2D>("tiles-2"); }
public GameoverCommand(Game1 receiver) { this.receiver = receiver; }
public EnemyFactory(Game1 game) { this.texture = game.Content.Load<Texture2D>("Enemies"); }
public VictoryScreen(Game1 game) { this.game = game; texture = game.Content.Load<Texture2D>("victory"); oldState = Keyboard.GetState(); }
public GameOverScreen(Game1 game) { this.game = game; texture = game.Content.Load<Texture2D>("gameover"); oldState = Keyboard.GetState(); }
public ItemFactory(Game1 game) { this.texture = game.Content.Load<Texture2D>("items-objects"); }
public BlockFactory(Game1 game) { this.texture = game.Content.Load<Texture2D>("tiles-2"); this.texture2 = game.Content.Load<Texture2D>("items-objects"); this.game = game; }
public MuteCommand(Game1 receiver) { this.receiver = receiver; }
public PauseCommand(Game1 receiver) { this.receiver = receiver; }
public QuitCommand(Game1 receiver) { this.receiver = receiver; }
public VictoryCommand(Game1 receiver) { this.receiver = receiver; }
public ResetCommand(Game1 receiver) { this.receiver = receiver; }