public void LevelReset() { Vector2 restartPoint = GameObjectManager.restartPoint; spriteBatch = new SpriteBatch(GraphicsDevice); #region Load Textures MarioSpriteFactory.Instance.LoadAllTextures(Content); EnemySpriteFactory.Instance.LoadAllTextures(Content); ItemSpriteFactory.Instance.LoadAllTextures(Content); BlockSpriteFactory.Instance.LoadAllTextures(Content); FireballSpriteFactory.Instance.LoadAllTextures(Content); BackgroundSpriteFactory.Instance.LoadAllTextures(Content); PipeSpriteFactory.Instance.LoadAllTextures(Content); SoundManager.Instance.LoadAllSounds(Content); TextSpriteFactory.Instance.LoadAllTextures(Content); #endregion Mario = new MarioObject(restartPoint); objectManager = new GameObjectManager(this, Mario); gamedata = new GameData(objectManager); camera1 = new Camera(); Camera.LimitationList.Add(3600); camera2 = new Camera2D(GraphicsDevice.Viewport); blackbackground = BackgroundSpriteFactory.Instance.CreateBlackBackgroundSprite(); LevelLoader loader = new LevelLoader(objectManager, Mario); loader.Load(); keyboard = new KeyboardControls(this, Mario); gamepad = new GamePadControls(this, Mario); Camera.SetCamera(new Vector2(restartPoint.X - 16 * 5, 0)); MarioInfo.ClearTimer(); MarioInfo.ResetTimer(); MarioInfo.StartTimer(); }
public void Reset() { LoadContent(); Camera.ResetCamera(); MarioInfo.ResetTimer(); MarioInfo.StartTimer(); }
public void Reset() { LoadContent(); Camera.ResetCamera(); CoinSystem.Instance.ResetCoin(); ScoringSystem.ResetScore(); MarioInfo.ResetTimer(); MarioInfo.StopTimer(); }
/// <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) { keyboard.Update(); gamepad.Update(); if (State.Type != SuperMario.Interfaces.GameStates.Pause) { objectManager.Update(); } MarioInfo.timeCount(gameTime, Mario); camera2.LookAt(new Vector2(Mario.Location.X - 20, GraphicsDevice.Viewport.Height / 2)); base.Update(gameTime); }