Ejemplo n.º 1
0
    // End Current Game
    private void EndGame()
    {
        //Debug.Log("GAMEOVER");
        if (_Controller == Control.NEURAL_NETWORL)
        {
            // Count total empty spaces
            float empty_slots = TetrisBoard._TotalCells - TetrisBoard.CountSolidsInBoard();
            IncreaseFitness(ScoreSystemManager.GetCurrent().GameOver_EmptySlots *empty_slots);

            // Increase Fitness by the
            IncreaseFitness(ScoreSystemManager.GetCurrent().Per_Piece_Placed *(float)_PiecesUsed);

            // Calculate Fitness from Heuristics
            TetrisPerceptronManager.GetInstance().FinishCurrentAI(_Fitness);
            GameplayManager.GetInstance()._Histogram.AddValue(_Fitness);
        }

        ResetGame();
    }