public override void Draw(SpriteBatch spriteBatch) { for (var x = 0; x < 20; x++) { for (var y = 0; y < 12; y++) { spriteBatch.Draw(SpriteLoader.IosMainSheet, new Vector2(x * 64, y * 64), MainMenuScreen.GetTile(tiling[y * 20 + x], 0), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.10f); } } for (var i = 0; i < flowers.Count; i++) { if (flowers[i].Active) { flowers[i].Draw(spriteBatch); } } if (ScreenManager.GameReference.PlacardState != TempleMain.PlacardSlideStates.Closed) { spriteBatch.Draw(SpriteLoader.IosMainSheet, new Vector2(276, ScreenManager.GameReference.YPlacardOffset), new Rectangle(1296, 1680, 728, 104), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f); } ControlManager.Draw(spriteBatch); }
public void ScreenControl(Screens screen, string command) { switch (screen) { case Screens.TitleScreen: if (command == "Next") { titleScreen.ScreenState = ScreenStates.FINISHED; } else if (command == "Begin") { mainMenuScreen = new MainMenuScreen(stateManager, titleScreen.Tiling, Screens.MainMenuScreen); stateManager.AddScreen(mainMenuScreen); PieceTemplate.SetColorFamilies(Player.ColorPreference); } else if (command == "NewUser") { InitUser("Player"); } break; case Screens.ClassicScreen: if (command == "Lost") { var seasonz = (gamePlayScreen.Year - 1) * 4; seasonz += (int)gamePlayScreen.Season + 1; endStageScreen = new EndStageScreen(stateManager, Screens.EndStageScreen, command, gamePlayScreen.Score, gamePlayScreen.TotalMatches); stateManager.AddScreen(endStageScreen); endStageScreen.EndSeason = seasonz; gamePlayScreen.ScreenState = ScreenStates.FINISHED; SaveUser(); } else if (command == "Save") { SaveUser(); } else if (command == "Pause") { pauseScreen.ScreenState = ScreenStates.ACTIVE_DRAW; pauseScreen.Caller = "Classic"; gamePlayScreen.ScreenState = ScreenStates.IDLE_NODRAW; } else if (command == "Won") { var seasonz = (gamePlayScreen.Year - 1) * 4; seasonz += (int)gamePlayScreen.Season + 1; endStageScreen = new EndStageScreen(stateManager, Screens.EndStageScreen, command, gamePlayScreen.Score, gamePlayScreen.TotalMatches); stateManager.AddScreen(endStageScreen); endStageScreen.EndSeason = seasonz; gamePlayScreen.ScreenState = ScreenStates.FINISHED; SaveUser(); } else if (command == "InterSave") { gamePlayScreen.FinalizeGamePlay(Player); SaveUser(); } break; case Screens.OptionsScreen: if (command == "Back") { optionsScreen.ScreenState = ScreenStates.FINISHED; mainMenuScreen.ScreenState = ScreenStates.ACTIVE_DRAW; optionsScreen = null; SaveUser(); } else if (command == "Tiles") { Player.SetData(); SaveUser(); } else if (command == "BackPause") { optionsScreen.ScreenState = ScreenStates.FINISHED; pauseScreen.ScreenState = ScreenStates.ACTIVE_DRAW; SaveUser(); optionsScreen = null; } else if (command == "Reset") { Player.TutorialPlayed = false; SaveUser(); } else { PieceTemplate.SetColorFamilies(command); Player.SetData(command); SaveUser(); } break; case Screens.EndStageScreen: if (command == "Back") { endStageScreen.ScreenState = ScreenStates.FINISHED; mainMenuScreen.ScreenState = ScreenStates.ACTIVE_DRAW; Player.UpdateUser(endStageScreen.FullXPPool, endStageScreen.XPForThisLevel, endStageScreen.CurrentLvl); SaveUser(); endStageScreen = null; gamePlayScreen = null; pauseScreen = null; SoundBoard.MusicControl("ToMenu"); } break; case Screens.MainMenuScreen: if (command == "Exit") { Exit(); } else if (command == "Endurance") { mainMenuScreen.ScreenState = ScreenStates.IDLE_NODRAW; pauseScreen = new PauseScreen(stateManager, Screens.PauseScreen); pauseScreen.ScreenState = ScreenStates.IDLE_NODRAW; stateManager.AddScreen(pauseScreen); gamePlayScreen = new GamePlayScreen(stateManager, Screens.EnduranceScreen); stateManager.AddScreen(gamePlayScreen); SoundBoard.MusicControl("ToPlay"); } else if (command == "Classic") { mainMenuScreen.ScreenState = ScreenStates.IDLE_NODRAW; pauseScreen = new PauseScreen(stateManager, Screens.PauseScreen); pauseScreen.ScreenState = ScreenStates.IDLE_NODRAW; stateManager.AddScreen(pauseScreen); if (Player.ZenSavedScore == 0) { gamePlayScreen = new GamePlayScreen(stateManager, Screens.ClassicScreen); stateManager.AddScreen(gamePlayScreen); } else { gamePlayScreen = new GamePlayScreen(stateManager, Screens.ClassicScreen); stateManager.AddScreen(gamePlayScreen); gamePlayScreen.IntroduceSaveData(Player); } SoundBoard.MusicControl("ToPlay"); } else if (command == "Stats") { mainMenuScreen.ScreenState = ScreenStates.IDLE_NODRAW; statsScreen = new StatsScreen(stateManager, Screens.StatsScreen); stateManager.AddScreen(statsScreen); //tutorialScreen = new TutorialScreen(stateManager, Screens.TutorialScreen); //stateManager.AddScreen(tutorialScreen); } else if (command == "Options") { optionsScreen = new OptionsScreen(stateManager, Screens.OptionsScreen, "Menu"); stateManager.AddScreen(optionsScreen); mainMenuScreen.ScreenState = ScreenStates.IDLE_NODRAW; } break; //case Screens.TutorialScreen: // if (command == "Done") // { // tutorialScreen.ScreenState = ScreenStates.FINISHED; // mainMenuScreen.ScreenState = ScreenStates.ACTIVE_DRAW; // } //break; case Screens.EnduranceScreen: if (command == "Won") { var seasonz = (gamePlayScreen.Year - 1) * 4; seasonz += (int)gamePlayScreen.Season + 1; endStageScreen = new EndStageScreen(stateManager, Screens.EndStageScreen, command, gamePlayScreen.Score, gamePlayScreen.TotalMatches); stateManager.AddScreen(endStageScreen); endStageScreen.EndSeason = seasonz; gamePlayScreen.ScreenState = ScreenStates.FINISHED; Player.BoardRocks = null; Player.CurrentZenSeason = 0; Player.SavedZenPieces.Clear(); Player.UsedPieceCount = null; Player.ZenSavedScore = 0; SaveUser(); } else if (command == "Lost") { var seasonz = (gamePlayScreen.Year - 1) * 4; seasonz += (int)gamePlayScreen.Season + 1; endStageScreen = new EndStageScreen(stateManager, Screens.EndStageScreen, command, gamePlayScreen.Score, gamePlayScreen.TotalMatches); stateManager.AddScreen(endStageScreen); endStageScreen.EndSeason = seasonz; gamePlayScreen.ScreenState = ScreenStates.FINISHED; SaveUser(); } else if (command == "Pause") { pauseScreen.ScreenState = ScreenStates.ACTIVE_DRAW; pauseScreen.Caller = "Zen"; gamePlayScreen.ScreenState = ScreenStates.IDLE_NODRAW; } break; case Screens.PauseScreen: if (command == "ClassicUn") { pauseScreen.ScreenState = ScreenStates.IDLE_NODRAW; gamePlayScreen.ScreenState = ScreenStates.ACTIVE_DRAW; } else if (command == "ZenUn") { pauseScreen.ScreenState = ScreenStates.IDLE_NODRAW; gamePlayScreen.ScreenState = ScreenStates.ACTIVE_DRAW; } else if (command == "ZenEnd") { var seasonz = (gamePlayScreen.Year - 1) * 4; seasonz += (int)gamePlayScreen.Season + 1; pauseScreen.ScreenState = ScreenStates.FINISHED; gamePlayScreen.ScreenState = ScreenStates.FINISHED; endStageScreen = new EndStageScreen(stateManager, Screens.EndStageScreen, command, gamePlayScreen.Score, gamePlayScreen.TotalMatches); stateManager.AddScreen(endStageScreen); endStageScreen.EndSeason = seasonz; SaveUser(); } else if (command == "ClassicEnd") { pauseScreen.ScreenState = ScreenStates.FINISHED; gamePlayScreen.FinalizeGamePlay(Player); SaveUser(); gamePlayScreen.ScreenState = ScreenStates.FINISHED; mainMenuScreen.ScreenState = ScreenStates.ACTIVE_DRAW; gamePlayScreen = null; SoundBoard.MusicControl("ToMenu"); } else if (command == "OptionsGame") { pauseScreen.ScreenState = ScreenStates.IDLE_NODRAW; optionsScreen = new OptionsScreen(stateManager, Screens.OptionsScreen, "GamePaused"); stateManager.AddScreen(optionsScreen); } break; case Screens.StatsScreen: if (command == "Back") { mainMenuScreen.ScreenState = ScreenStates.ACTIVE_DRAW; statsScreen.ScreenState = ScreenStates.FINISHED; } break; } }
public override void Draw(SpriteBatch spriteBatch) { if (ready) { if (Tiling != null) { for (var x = 0; x < 20; x++) { for (var y = 0; y < 12; y++) { spriteBatch.Draw(SpriteLoader.IosMainSheet, new Vector2(x * 64, y * 64), MainMenuScreen.GetTile(Tiling[y * 20 + x], 0), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.45f); } } } spriteBatch.Draw(SpriteLoader.IosMainSheet, titleTextPosition, new Rectangle(1280, 0, 672, 280), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.65f); spriteBatch.Draw(SpriteLoader.IosMainSheet, new Vector2(titleTextPosition.X + 32, titleTextPosition.Y + 32), new Rectangle(1280, 320, 672, 280), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.64f); foreach (var flower in flowerPool) { if (flower.Active) { spriteBatch.Draw(SpriteLoader.IosMainSheet, flower.Position, GetFlowerSource(flower.FlowerType, 1), flower.FlowerColor, 0f, FlowersTitle.Origin, flower.Scale, SpriteEffects.None, 0.62f); spriteBatch.Draw(SpriteLoader.IosMainSheet, flower.Position, GetFlowerSource(flower.FlowerType, 2), flower.FlowerColor, 0f, FlowersTitle.Origin, flower.Scale, SpriteEffects.None, 0.62f); spriteBatch.Draw(SpriteLoader.IosMainSheet, new Vector2(flower.Position.X + 6, flower.Position.Y + 6), GetFlowerSource(flower.FlowerType, 3), Color.White, 0f, FlowersTitle.Origin, flower.Scale, SpriteEffects.None, 0.61f); } } foreach (var bee in bees) { spriteBatch.Draw(SpriteLoader.IosMainSheet, bee.Position, Bee.GetSource(bee.Flap), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.63f); } } else { spriteBatch.Draw(SpriteLoader.IosMainSheet, new Vector2(368, 200), new Rectangle(0, 1664, 544, 320), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.44f); } ControlManager.Draw(spriteBatch); }