/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); RouliFont = Content.Load <SpriteFont>("Rouli"); MiniGameManager.LoadContent(Content); // This will call the LoadContent function of your minigame class }
public virtual void Update(GameTime gameTime) { if (game_status == GameStatus.Pending) { timer += gameTime.ElapsedGameTime.Milliseconds; } else { outro_time += gameTime.ElapsedGameTime.Milliseconds; } if (timer > time_limit) { this.Lose(); } if (outro_time > 800 && game_status == GameStatus.Win) { MiniGameManager.Win(); // Will call the next game } if (outro_time > 800 && game_status == GameStatus.Lose) { MiniGameManager.Lose(); // Will call the next game } }
/// <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() { // TODO: Add your initialization logic here MiniGameManager.AddMiniGame(new KeyboardGame()); MiniGameManager.AddMiniGame(new DabGame()); base.Initialize(); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); MiniGameManager.Draw(spriteBatch); // And this will call your minigame's draw function! spriteBatch.End(); base.Draw(gameTime); }
public static void Update(GameTime gameTime) { lifetime -= gameTime.ElapsedGameTime.Milliseconds; transition_timer += gameTime.ElapsedGameTime.Milliseconds; if (lifetime <= 0 && life_counter > 0) { is_over = true; MiniGameManager.NextMiniGame(); } }
/// <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() { // If you want the game to only play your minigame in order to test it, please remove every other game and add only yours to MiniGameManager // MiniGameManager.AddMiniGame(TemplateGame)); MiniGameManager.AddMiniGame(new KeyboardGame()); MiniGameManager.AddMiniGame(new DabGame()); MiniGameManager.AddMiniGame(new TaupeGame()); base.Initialize(); }
/// <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() { // If you want the game to only play your minigame in order to test it, please remove every other game and add only yours to MiniGameManager //MiniGameManager.AddMiniGame(new TemplateGame()); MiniGameManager.AddMiniGame(new PizzaGame()); MiniGameManager.AddMiniGame(new KeyboardGame()); MiniGameManager.AddMiniGame(new DabGame()); MiniGameManager.AddMiniGame(new TaupeGame()); MiniGameManager.AddMiniGame(new BananeGame()); MiniGameManager.AddMiniGame(new GordonMinerGame()); MiniGameManager.AddMiniGame(new ChooseServiceGame()); MiniGameManager.AddMiniGame(new RecognitionGame()); base.Initialize(); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { Input.Update(gameTime); MiniGameManager.Update(gameTime); // This will call your minigame's update function for you base.Update(gameTime); }