public PlayGameEvent(MiniGames _game, int _difficulty) { game = _game; difficulty = _difficulty; }
public ShowOptionsEvent(MiniGames _game, int _difficulty, int _candy) { game = _game; difficulty = _difficulty; candy = _candy; }
public void onShowOptions(ShowOptionsEvent e) { optionsPanel.SetActive(true); candyValue = e.candy; game = e.game; difficulty = e.difficulty; // Determine which sprites to show and what text // Game Sprite switch (e.game) { case MiniGames.AppleBobbing: miniGameImage.sprite = appleImage; break; case MiniGames.CornMaze: miniGameImage.sprite = mazeImage; break; case MiniGames.PumpkinCarving: miniGameImage.sprite = pumpkinImage; break; default: break; } // Game difficulty switch (e.difficulty) { case 1: trickLevelText.text = "Easy"; break; case 2: trickLevelText.text = "Normal"; break; case 3: trickLevelText.text = "Hard"; break; default: break; } // Candy Sprite switch (e.candy) { case 0: // no candy :( break; case 1: candyImage.sprite = candyOne; break; case 2: candyImage.sprite = candyOne; break; case 3: candyImage.sprite = candyTwo; break; case 4: candyImage.sprite = candyTwo; break; case 5: candyImage.sprite = candyThree; break; case 6: candyImage.sprite = candyThree; break; default: break; } // Candy Text candyCountText.text = e.candy.ToString() + " Candy!"; }
//Function to load the minigames void callMiniGame(MiniGames mg) { switch (mg) { case MiniGames.mini1: GM.Get().scene.miscRefs[15].SetActive(false); GM.Get().scene.miscRefs[10].SetActive(true); gameController_1.Init(); break; case MiniGames.mini2: GM.Get().scene.miscRefs[15].SetActive(false); GM.Get().scene.miscRefs[11].SetActive(true); gameController_2.Init(); break; case MiniGames.mini3: GM.Get().scene.miscRefs[15].SetActive(false); GM.Get().scene.miscRefs[12].SetActive(true); gameController_3.Init(); break; } return; }
public override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Escape)) Game.Exit(); Camera.Update(gameTime); KeyboardState keyboardState = Keyboard.GetState(); if((keyboardState.IsKeyDown(Keys.F10))) { PersistentStorage.resetTrophies(); } // Checks whether the "unload" flag has been set in the current mini-game. // We are using this flag b.c the items in the SeriousGameLib cannot reference // to kantoor3D due to a (then created) circular depenancy. if (CurrentMiniGame != null && CurrentMiniGame.ForceUnload) { if (CurrentMiniGame.LoadAfter != MiniGames.NONE) { lastLoadAfter = CurrentMiniGame.LoadAfter; // Load game? well, first unload, then load. UnloadMiniGame(); } else { UnloadMiniGame(); } } switch (CurrentGameState) { case GameStates.KANTOOR: handleKantoorInput(gameTime); break; case GameStates.MINIGAME: if (CurrentMiniGame != null) CurrentMiniGame.Update(gameTime); break; case GameStates.AFLEVERING: if (Aflevering != null) Aflevering.Update(gameTime); if (Aflevering != null && Aflevering.ForceUnload) { DrawWorld = true; Game.Components.Remove(Aflevering); Camera.ReturnFromLastGameObject(); Aflevering = null; CurrentGameState = GameStates.KANTOOR; Narrator.Instance.HideDolphin = false; Narrator.Instance.Show(); AudioFactory.PlayOnce("kantoortheme", true); } break; } // The game HUD is always shown. This too will render the "exit mini game" button. Hud.Update(gameTime); Narrator.Update(gameTime); base.Update(gameTime); }
public void CheckCommand(string command) { if (command.Contains("@Fionaa_bot")) { command = command.Replace("@Fionaa_bot", ""); } if (!commands.Contains(command)) { return; } switch (command) { case "/weather": Weather weather = new Weather(); weather.GetWeather(); break; case "/status": RankManager rank = new RankManager(); rank.Status(); break; case "/battle": if (BattleManager.online == true) { return; } BattleManager battlemanager = new BattleManager(e); battlemanager.PreBattle(); break; case "/stopb": Battle.StopBattle(); break; case "/list": ListGen list = new ListGen(); list.CreateList(); break; case "/roulette": Roulette roulette = new Roulette(); roulette.CreateRoll(); break; case "/inv": Inventory inv = new Inventory(); inv.GetInventory(e.Message.From.Username); break; case "/ranktop": RankManager rankm = new RankManager(); rankm.TopRank(); break; case "/players": MiniGames min2 = new MiniGames(e.Message); min2.GetPlayers(); break; case "/game": MiniGames min = new MiniGames(e.Message); min.AddPlayer(); break; case "/test": Test test = new Test(); test.testing(); break; } }
void Camera_CameraArrived(GameObject3D gameObject, bool isMovingToOrigin) { if (!isMovingToOrigin) { CurrentMiniGame = _tempWorld; CurrentGameState = GameStates.MINIGAME; if (CurrentMiniGame is Schilder.Schilder) { GetGameObject3D("schildersezel").Visible = false; GetGameObject3D("boekenkast").Visible = false; } if (CurrentMiniGame is Uitnodiging.Uitnodiging) { GetGameObject3D("puzzeldoos").Visible = false; GetGameObject3D("laptop").Visible = false; } if (CurrentMiniGame is Ontwerpen.Ontwerpen) { GetGameObject3D("globe").Visible = false; GetGameObject3D("memoryTableObject").Visible = false; } // A sepearte function call is required as some GameWorld instances call the Initialize themselfs. if (CurrentMiniGame != null) { CurrentMiniGame.OnCameraArrive(); } if (gameObject.MiniGameType == MiniGames.AFLEVERING) { Narrator.Hide(); Narrator.RemoveAllButtons(); AudioFactory.PlayOnce("door"); if (CurrentMiniGame != null) { CurrentMiniGame.CleanUp(); CurrentMiniGame = null; } Aflevering = new Aflevering.Aflevering(Game); Aflevering.Initialize(); DrawWorld = false; CurrentGameState = GameStates.AFLEVERING; Narrator.Instance.Hide(); Narrator.Instance.HideDolphin = true; } } else { PlayerObject.Position = Camera.Position; Game.IsMouseVisible = true; if (lastLoadAfter != MiniGames.NONE) { //load minigame switch (lastLoadAfter) { case MiniGames.AFLEVERING: Camera.MoveToGameObject(GetGameObject3D("deur"), 1000.0f); break; case MiniGames.FOTOGRAAF: LoadMiniGame(GetGameObject3D("tafelfotograaf")); break; case MiniGames.ONTWERPEN: LoadMiniGame(GetGameObject3D("tafelontwerpen")); break; case MiniGames.SCHILDER: LoadMiniGame(GetGameObject3D("schildersezel")); break; case MiniGames.UITNODIGING: LoadMiniGame(GetGameObject3D("tafeluitnodiging")); break; } lastLoadAfter = MiniGames.NONE; } } }