protected override void Draw(GameTime gameTime) { if (atMainMenu) { home.Draw(spriteBatch, GraphicsDevice); } else { if (!(curLevel.Contains("Underground") || curLevel.Contains("Four"))) { GraphicsDevice.Clear(Color.CornflowerBlue); } else { GraphicsDevice.Clear(Color.Black); } if (!isGameOver) { GameNotOverDraw(gameTime); } else { MusicManager.Instance.StopBackgroundMusic(); parser.Draw(); Mario.Draw(spriteBatch); UI.Draw(spriteBatch); trophy.Draw(); if (delay > 150) { load.GameOver(spriteBatch); if (!soundPlayed) { MarioWorldSoundBoard.Instance.PlayGameOver(); soundPlayed = true; } else if (soundPlayed && delay > 350) { changer.changeLevel(); LevelChanger.SetBGMusic(curLevel); delay = 0; soundPlayed = false; st = new ScoreTracker(); isGameOver = false; } } delay++; } } }
public override void Draw(SpriteBatch batch) { Mario.Draw(batch); base.Draw(batch); }
protected void GameNotOverDraw(GameTime gameTime) { parser.Draw(); trophy.Draw(); Mario.Draw(spriteBatch); pauser.Draw(); if ((Mario.Health() == MarioStateMachine.MarioHealth.Dead && deathDelayScreen > 70 && st.Lives >= 0 && !(UI.getTime() <= 0)) || changingLevel) { load.Draw(spriteBatch); if (delay > 100) { changingLevel = false; st.EndStarCombo(); deathDelayScreen = 0; delay = 0; st.LoseLife(); st.AllowFlagpolePoints(); st.TimePoints(UI.Time); UI.SetTimer(400); } else { delay++; } } else if ((Mario.Health() == MarioStateMachine.MarioHealth.Dead && !(UI.getTime() <= 0) || changingLevel) && st.Lives < 0) { isGameOver = true; changingLevel = false; } if (needBlackScreen) { load.BlackScreen(); if (delay > 30) { needBlackScreen = false; delay = 0; } else { delay++; } } if (UI.getTime() <= 0) { if (Mario.Health() == MarioStateMachine.MarioHealth.Normal && !alreadyKilled) { Mario.KillMario(); alreadyKilled = true; } if (deathDelayScreen > 70) { load.TimeUp(spriteBatch); if (delay > 150) { alreadyKilled = false; st.EndStarCombo(); deathDelayScreen = 0; delay = 0; st.LoseLife(); st.AllowFlagpolePoints(); st.TimePoints(UI.Time); UI.SetTimer(400); } else { delay++; } } } UI.Draw(spriteBatch); editor.Draw(spriteBatch); if (Mario.Health() == MarioStateMachine.MarioHealth.Dead) { deathDelayScreen++; } base.Draw(gameTime); }