public static void Initialize(GameScreen initialGameScreen) { _currentGameState = CurrentGameState.Loading; _loadingScreen = new SplashScreen(); _loadingScreen.Initialise(); }
public static void ShowTitleScreen() { _titleScreen = new TitleScreen(); _currentGameState = CurrentGameState.TitleScreen; _titleScreen.Initialise(); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(RaymondsCloneWasTheCulprit))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(RaymondsCloneLaunchedTheShip)) && CurrentGameState.IsThinking(nameof(YourBeingRidiculous))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ElectricDischarge))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(WarrenIntroduction))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ElectricDischarge)) && (CurrentGameState.IsThinking(nameof(YouAreStillResposible)) || CurrentGameState.IsThinking(nameof(WontTurnYouInForRaymondsAction)))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(RaymondsCorpse))); }
void OnTriggerEnter2D(Collider2D collider) { if (collider.transform.parent.tag == "Player1") { if (playerThatLost == "Player2") { bothPlayersLost = true; } playerThatLost = "Player1"; currentGameState = CurrentGameState.DelayBeforeWin; player1Script.GameOver = true; player2Script.GameOver = true; } else if (collider.transform.parent.tag == "Player2") { if (playerThatLost == "Player1") { bothPlayersLost = true; } playerThatLost = "Player2"; currentGameState = CurrentGameState.DelayBeforeWin; player1Script.GameOver = true; player2Script.GameOver = true; } }
public static void StartNewGame() { _inGameScreen = new IngameScreen(); _currentGameState = CurrentGameState.Ingame; _inGameScreen.Initialise(); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(UnencryptedDataDrive))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(YouAreAHacker)) && !CurrentGameState.IsThinking(nameof(IWontReportDataRaven))); }
private void Instance_OnGameStop(RealmEventArgs args) { CurrentGameState.Save(Kernel.Get <IRealmLiveDbContext>()); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(MatterRemovalBruises))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ZaidLaunchedTheShip)) && (CurrentGameState.IsThinking(nameof(IWontSealYourFate)) || CurrentGameState.IsThinking(nameof(YouBroughtThisOnYourself)))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ZaidHackedTheDoor)) && CurrentGameState.IsThinking(nameof(ZaidsAccount))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(YouAreAHacker)) && !CurrentGameState.IsThinking(nameof(DeckersMakeTheWorldWorse))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(FoundYouRaymondsClone))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(NeedASearchOrder)) && !CurrentGameState.IsThinking(nameof(ZaidsAccount))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ViolentExperimentalResearch))); }
public NavigationRoutine(CurrentGameState gameState) { GameState = gameState; }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(YourBeingRidiculous)) && !CurrentGameState.IsThinking(nameof(YouCanKeepYourLife))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ResortManagerZaid)) || CurrentGameState.IsThinking(nameof(WhoAreYouZaid))); }
public void Update() { if (!canInput) { return; } //if (Time.timeScale == 0 && Input.anyKey) return; timer += Time.deltaTime; if (timer >= 3f) { GameStatusCheck(); timer = 0; } if (currentGameState == CurrentGameState.Dialog) { if (Input.GetKeyDown(KeyCode.Mouse0) || Input.GetKeyDown(KeyCode.Space)) { UserInterface.Instance.Dialog.NextDialog(); } } if (Input.GetKeyDown(KeyCode.Escape)) { if (currentGameState == CurrentGameState.Dialog || currentGameState == CurrentGameState.Loading || currentGameState == CurrentGameState.MissionClear || UserInterface.Instance.MissionSelectionUICanvas.activeSelf) { return; } if ( MCSceneManager.currentScene != MCSceneManager.TITLE && currentGameState != CurrentGameState.Loading && currentGameState != CurrentGameState.Dialog && currentGameState != CurrentGameState.Product && currentGameState != CurrentGameState.MissionClear) { isPause = !isPause; Debug.Log("Press Escape : " + isPause); CanvasInfo.PauseMenuActive(isPause); GameManager.Instance.IsPuase = isPause; UserInterface.BlurSet(isPause, 10f); SetCurrentGameState(isPause ? CurrentGameState.Pause : prevState); } if (currentGameState == CurrentGameState.Product) { if (MCSceneManager.currentScene == MCSceneManager.BOSS) { BossDirector.Instance.PlayScene(); } if (MCSceneManager.currentScene == MCSceneManager.TITLE) { FindObjectOfType <TitleCutScene>().CineEnd(); } } } if (GameStatus.currentGameState != CurrentGameState.Product) { if (UserInterface.Instance.ClearMission.gameObject.activeSelf && (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Mouse0))) { UserInterface.Instance.ClearMission.gameObject.SetActive(false); currentGameState = CurrentGameState.Wait; PlayerFSMManager.Instance.GetComponent <PlayerCLEAR>().CMSet.gameObject.SetActive(false); PlayerFSMManager.Instance.SetState(PlayerState.IDLE); PlayerFSMManager.Instance.mainCamera.gameObject.SetActive(true); Invoke("DialogCheck", 0.5f); MissionManager.Instance.CurrentMission.PortalPlay(); } } #if UNITY_STANDALONE #endif if (currentGameState == CurrentGameState.Start && MissionManager.Instance.CurrentMission.MissionOperate && !MissionManager.Instance.CurrentMission.missionEnd) { _LimitTime -= Time.deltaTime; } }
void Update() { if (currentGameState == CurrentGameState.Playing) { } else if (currentGameState == CurrentGameState.DelayBeforeWin) { elapsedTime += Time.deltaTime; if (elapsedTime >= timeUntilPersonLoses) { volcanoParticles.Play(); currentGameState = CurrentGameState.SomeoneWins; if (bothPlayersLost) { winText.text = "Nobody Wins..."; if (SoundManager.instance != null) { Debug.Log("Tried to play boo"); if (!SoundManager.instance.sfxSource.isPlaying) { SoundManager.instance.PlaySound("Boo"); } } } else if (playerThatLost == "Player1") { winText.text = "Player 2 Wins!"; winningPlayerSkeleton = Player2.GetComponent<SkeletonRagdoll2D>(); winningPlayerRigidBody = winningPlayerSkeleton.GetRigidbody("Torso"); winningPlayerParticles = Player2.GetComponentInChildren<ParticleSystem>(); winningPlayerParticles.Play(); ExplosionCollider.transform.position = new Vector3(winningPlayerRigidBody.transform.position.x, ExplosionCollider.transform.position.y, ExplosionCollider.transform.position.z); Moon.transform.position = ExplosionCollider.transform.position; TopHitBox.gameObject.SetActive(false); Destroy(GetComponent<BoxCollider2D>()); } else if (playerThatLost == "Player2") { winText.text = "Player 1 Wins!"; winningPlayerSkeleton = Player1.GetComponent<SkeletonRagdoll2D>(); winningPlayerRigidBody = winningPlayerSkeleton.GetRigidbody("Torso"); winningPlayerParticles = Player1.GetComponentInChildren<ParticleSystem>(); winningPlayerParticles.Play(); ExplosionCollider.transform.position = new Vector3(winningPlayerRigidBody.transform.position.x, ExplosionCollider.transform.position.y, ExplosionCollider.transform.position.z); Moon.transform.position = ExplosionCollider.transform.position; TopHitBox.gameObject.SetActive(false); Destroy(GetComponent<BoxCollider2D>()); } winControlText.gameObject.SetActive(true); elapsedTime = 0; } } else if (currentGameState == CurrentGameState.SomeoneWins) { elapsedTime += Time.deltaTime; if (elapsedTime >= timePerFlash) { elapsedTime = 0; winText.gameObject.SetActive(!winText.gameObject.activeSelf); } if (!bothPlayersLost) { winningPlayerParticles.transform.position = winningPlayerRigidBody.transform.position; winningPlayerRigidBody.velocity = new Vector2(0, floatingForce); if (DEBUG) { Debug.Log("Winning player is being lifted"); } if (Camera.main.transform.position.y < winningPlayerRigidBody.position.y && Camera.main.transform.position.y < ExplosionCollider.transform.position.y) { Camera.main.transform.position = new Vector3(Camera.main.transform.position.x, winningPlayerRigidBody.position.y, Camera.main.transform.position.z); } else if (Camera.main.transform.position.y > ExplosionCollider.transform.position.y) { winningPlayerParticles.Stop(); floatingForce = 0; } } else { if (Input.GetButton("B1") || Input.GetKeyDown(KeyCode.B)) { SceneManager.LoadScene("TeamSelect"); } else if (Input.GetButton("A1") || Input.GetKeyDown(KeyCode.A)) { SceneManager.LoadScene("Game"); } } } }
public static void SetCurrentGameState(CurrentGameState state) { prevState = currentGameState; currentGameState = state; }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(TravissAccount))); }
public override bool IsActive() { return((CurrentGameState.IsThinking(nameof(YouAreStillResposible)) || CurrentGameState.IsThinking(nameof(WontTurnYouInForRaymondsAction))) && CurrentGameState.IsThinking(nameof(YourBrotherWasKilled))); }
public override string WhereAreYou() { return(CurrentGameState.IsThinking(nameof(BetweenSevenAMToEightPM)) ? nameof(DockingBay) : nameof(PoliceCruiserInterior)); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(ZaidWasTheCulprit)) && CurrentGameState.IsThinking(nameof(YouWereNotAcceptedForBetaTesting))); }
public void GoNext() { CurrentGameState.goNext(this); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(WhoIsStayingAtYourResort))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(HackerMeleena)) && CurrentGameState.IsThinking(nameof(WhoAreYou))); }
public override bool IsActive() { return(CurrentGameState.IsThinking(nameof(FromAnytimeUntilEightPM))); }
public void ValidateRoundSkip(CurrentGameState gameState, int userId) { BaseGameValidations(gameState, userId); }
public MainRoutine(CurrentGameState currentGameState) { GameState = currentGameState; NavRout = new NavigationRoutine(GameState); }
public static void StartNewGame() { _inGameScreen = new IngameScreen(); _inGameScreen.Initialise(); LevelManager.Initialise(); LevelManager.SetLevel(4); var allElements = LevelManager.CurrentLevel.GetAllElements(); allElements.ForEach(c => _inGameScreen.Elements.Add(c)); // Add player frogs Actor player = new Frog() { Sprite = GraphicsManager.GetSprite(FroggerGame.Textures.GreenFrog), X = 320, Y = 448, MovementBehaviour = new KeyboardMovementBehaviour(0) }; Players.Add(player); Actor car = new Car() { Sprite = GraphicsManager.GetSprite(FroggerGame.Textures.Car), X = GraphicsManager.RESOLUTION_X, Y = 230 }; _inGameScreen.Elements.Add(player); _inGameScreen.Elements.Add(car); car.Initialize(); player.Initialize(); _currentGameState = CurrentGameState.Ingame; }