public void ResetLevel() { _player.Reset(); foreach (EnemyCharacter enemy in _enemies) { enemy.Reset(); } }
private void RespawnPlayer() { Debug.Log("respawn"); score.Reset(); player.Reset(); player.transform.position = canyon.GetEnterPoint(); isFinish = false; PauseGame(false); PlaySnowIfNeeded(); }
// We want to reuse this object instead of creating new ones each generation. public void Reset(Vector2 playerPos, bool resetFitness = false, FeedForwardNN brain = null) { Brain = brain ?? Brain; fitness = resetFitness ? Mathf.NegativeInfinity : fitness; hasMaxFitness = false; shotTheBall = false; shotTheBallRewarded = false; fitnessCanIncrease = false; touchedRightGoal = false; touchingRightGoal = false; touchedBall = false; touchingCorner = false; Player.Reset(playerPos); BallInitialPosition = Player.ballInitialPosition; }