Ejemplo n.º 1
0
 public void ResetLevel()
 {
     _player.Reset();
     foreach (EnemyCharacter enemy in _enemies)
     {
         enemy.Reset();
     }
 }
Ejemplo n.º 2
0
 private void RespawnPlayer()
 {
     Debug.Log("respawn");
     score.Reset();
     player.Reset();
     player.transform.position = canyon.GetEnterPoint();
     isFinish = false;
     PauseGame(false);
     PlaySnowIfNeeded();
 }
Ejemplo n.º 3
0
 // 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;
 }