public void executeGameover() { gamestate = Gamestate.gameOver; //Debug.LogWarning("executeGameover"); if (gamesPlayedCounter != null) { gamesPlayedCounter.increase(1); //log the number of played games } valueManager.instance.saveAllMinMaxValues(); //save min and max values for all values for the statistics tab if (HighScoreNameLinkerGroup.instance != null) { HighScoreNameLinkerGroup.instance.generateLinks(); } CardStack.instance.resetCardStack(); //reset the card stack CardStack.instance.clearFollowUpStack(); saveGameState(); string currentSceneName = SceneManager.GetActiveScene().name; OnGameOver.Invoke(); SceneManager.LoadScene(currentSceneName); //reload the scene for a clean startup of the game }
public override void GameOver() { if (OnGameOver != null) { OnGameOver.Invoke(); } }
private void onGameOverExecuteLogic() { if (r_BoardManager.IsAllCellsUncovered() && OnGameOver != null) { OnGameOver.Invoke(); } }
private void GameManager_OnGameStateChange(EGameStates GameState) { switch (GameState) { case EGameStates.MAIN_MENU: OnMainMenu?.Invoke(); break; case EGameStates.CONNECTING: break; case EGameStates.RELOADING_ROUND: break; case EGameStates.LOADING_NEXTROUND: OnRoundBegin.Invoke(); break; case EGameStates.LOADING_REMATCH: break; case EGameStates.GAMEPLAY: OnGameplayBegin?.Invoke(); break; case EGameStates.ROUND_OVER: OnRoundOver.Invoke(); break; case EGameStates.GAME_OVER: OnGameOver.Invoke(); break; } }
private void Win() { state = State.Won; WinScreen.SetActive(true); OnGameOver.Invoke(true); SaveData.GetInstance().SetMaxLevelReached(nextLevel); }
public static void OnGameOverInvoke(object sender = null) { if (OnGameOver != null) { OnGameOver.Invoke(null, EventArgs.Empty); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Enemy")) { transform.gameObject.SetActive(false); OnGameOver.Invoke(false); } }
public void GameOver() { IsGameOver = true; OnGameOver.Invoke(); gameOverUI.SetActive(true); Time.timeScale = 0f; }
private void GameOver() { if (OnGameOver != null) { OnGameOver.Invoke(); } sfxManager.PlaySound(sfxManager.earthExplosionClip); Destroy(gameObject); }
//Check public void WinCheck(CharController target, int score, bool playerBool) { if (LevelManager.Instance.levelGoal <= score) { WinSequence(target.transform, playerBool); OnGameOver += target.GetComponent <SimpleCharacterControl>().FinishedAnimation; OnGameOver.Invoke(); } }
private void Awake() { // Make the game run as fast as possible. Avoids setting to default frame rate on device. Application.targetFrameRate = 300; gameMode = GetComponent <GameMode>(); PlayerData.Create(); GameInitialized += delegate { OnGameIntialized.Invoke(); }; GameStarted += delegate { OnGameStarted.Invoke(); }; GameOver += delegate { OnGameOver.Invoke(); }; }
public static void KillCitizen(bool hasFinished) { if (!IsAlive) { return; } instance.activeCitizenCount--; if (hasFinished) { instance.hitpointCount--; if (OnCitizenFinished != null) { OnCitizenFinished.Invoke(); } if (instance.hitpointCount == 0) { instance.isPlaying = false; if (OnGameOver != null) { OnGameOver.Invoke(); } return; } } if (instance.activeCitizenCount == 0) { instance.isPlaying = false; instance.treeBatches[instance.currentWaveIndex - 1].FadeOut(); instance.houseBatches[instance.currentWaveIndex - 1].SetActive(true); instance.pavements[instance.currentWaveIndex - 1].SetActive(true); if (OnWaveEnded != null) { OnWaveEnded.Invoke(); } if (!HasWavesLeft) { if (OnGameOver != null) { OnGameOver.Invoke(); } } } }
public void HealthLoss() { if (life > 0) { life--; OnHealthLoss.Invoke(); if (life == 0) { OnGameOver.Invoke(); } } }
//---------------------GAME OVER -------------------------\\ public void GameOver() { if (_isGameOver) { return; } _isGameOver = true; if (OnGameOver != null) { OnGameOver.Invoke(); } }
public HitResult HitCheck(int ballColorId, int targetColorId) { HitResult hitResult; if (ballColorId == targetColorId) { playerState.Regen(); scoreKeeper.IncrementCurrentScore(playerState.Combo); hitResult = new HitResult { successfulHit = true, playerDead = false }; OnSuccessfulHit?.Invoke(); } else { playerState.TakeDamage(); OnDamage?.Invoke(); if (playerState.IsDead) { GameState = GameState.GameOver; OnGameOver?.Invoke(); hitResult = new HitResult { successfulHit = false, playerDead = true }; } else { hitResult = new HitResult { successfulHit = false, playerDead = false }; } } OnHit?.Invoke(); return(hitResult); }
public void MakeMove(int move) { if (CurrentState.IsValidMove(move)) { bool growthHappened = CurrentState.MakeMove(move); MoveHistory.Add(move); if (growthHappened) { MoveHistory.Add(Constants.AllGrowMove); } OnMoveMade?.Invoke(growthHappened); if (CurrentState.State == GameState.GameOver) { OnGameOver?.Invoke(CurrentState.Winner, CurrentState.Winner == Player.Draw ? VictoryType.InfiniteEruption : VictoryType.AntipodePathCreation); } else { ComputerPlay(); } } }
/// <summary> /// Call this method when player is dead /// </summary> private void PlayerController_OnPlayerDied() { _totalLife--; if (_totalLife < 0) { _totalLife = 0; } OnUpdatePlayerLife?.Invoke(_totalLife); OnRegroupEnemy?.Invoke(); if (_action != null) { StopCoroutine(_action); } if (_totalLife <= 0) { _isGameActive = false; _isPause = true; _isGameOver = true; _isAttackAble = false; if (_currentScore > _highScore) { _highScore = _currentScore; GameData.UpdateHighScore(this, _highScore); } OnGameOver?.Invoke(); } else { _isAttackAble = false; OnGameRetry?.Invoke(); } }
void CheckBulletsCollisions() { List <GameObj> outofrange = new List <GameObj>(); foreach (GameObj i in bullets.Concat(user.bullets)) { if (checkWalls(i, out GameObj col)) { if (col.name == "wall") { outofrange.Add(i); var boom = new GameObj(i.pos, exploisonsSize, animation: GetListFromImage(boomSprite, new Size(39, boomSprite.Height), 7), once: true) { name = "animation" }; animations.Add(boom); if (col.CanDestroy == true) { walls.Remove(col); } } } if (i.HitBox.IntersectsWith(user.HitBox) && i.name == "enemybullet") { OnGameOver?.Invoke(); break; } if (CheckBounds(i)) { outofrange.Add(i); } } outofrange.ForEach(x => bullets.Remove(x)); outofrange.ForEach(x => user.bullets.Remove(x)); }
public static void Damage() { if (!IsAlive) { return; } instance.hitpointCount--; if (OnCitizenFinished != null) { OnCitizenFinished.Invoke(); } if (instance.hitpointCount == 0) { instance.isPlaying = false; if (OnGameOver != null) { OnGameOver.Invoke(); } } }
public void ChangeGameState(EGameStates NewGameState) { gameState = NewGameState; CustomEvent.Trigger(gameObject, "_OnGamestateChange", NewGameState); OnGamestateChange?.Invoke(NewGameState); switch (gameState) { case EGameStates.GameBegin: OnGameBegin?.Invoke(); break; case EGameStates.MainMenu: OnGameOver?.Invoke(); break; case EGameStates.RoundOver: OnRoundOver?.Invoke(); break; } }
private void PlayerDied() { OnGameOver?.Invoke(GameOverReason.PlayedDied); }
void Update() { if (Input.GetKeyDown(KeyCode.Space)) { if (timeSlow) { timeSlow = false; Time.timeScale = 1f; Time.fixedDeltaTime = 0.02f; } else { timeSlow = true; Time.timeScale = slowTimeSpeed; Time.fixedDeltaTime = 0.02f * slowTimeSpeed; } } if (transform.position.y < -10 || Input.GetKeyDown(KeyCode.R)) { transform.rotation = Quaternion.identity; sphereRB.velocity = Vector3.zero; sphereRB.drag = normalDrag; sphereRB.gameObject.transform.position = startPos; transform.position = startPos; OnGameOver?.Invoke(); Debug.Log("GAME OVER!"); } if (isGrounded && Time.timeScale == 1) { speed += speedIncrement; OnSpeedChange?.Invoke(speed); //speedText.text = speed.ToString("F2") + "\nkm/hr"; } isDrifting = Input.GetButton("Jump"); if (Input.GetKey(KeyCode.X) && nitrousAmt > 0f) { nitrousAmt -= .06f; nitrousSpeedMultiplier = 2f; OnNitrousPickup?.Invoke(-.06f); // activate exhaust flames foreach (var n in nitrousFX) { n.gameObject.SetActive(true); n.Play(); } } else { nitrousSpeedMultiplier = 1f; // deactivate exhaust flames foreach (var n in nitrousFX) { n.Pause(); n.gameObject.SetActive(false); } } }
public void BroadcastGameOver() { OnGameOver?.Invoke(); }
void GameOver() { energyHandler.OnEnergyDepleeted -= GameOver; playerInputHandler.DisablePlayerInput(); OnGameOver?.Invoke(); }
private void Start() { OnGameOver?.Invoke(); }
public void PlayerClickBombYeet() { Debug.Log("u ded"); OnGameOver?.Invoke(); }
private void GameOver() { OnGameOver?.Invoke(); TapController.OnTap += GameStart; }
public void GameOver() => OnGameOver?.Invoke();
private void GameOver() { OnGameOver?.Invoke(); }
private void DOgameOver() { OnGameOver?.Invoke(this, new EventArgs()); }