Пример #1
0
    private void logMoveData()
    {
        //When a player moves, record the current time
        // when the player next moves, record the current time
        // subtract the previous move time from the current move time
        float currentTime     = Time.time;
        float currentMoveTime = currentTime - prevMoveEndTime;

        avg_time_per_move  += currentMoveTime;
        prevMoveEndTime     = currentTime;
        avg_turns_per_move += turnCount;
        turnCount           = 0;
        if (canMove() && statueArrowBottom.canMove() && statueArrowTop.canMove())
        {
            Debug.Log("ALL_MOVE");
            all_move++;
        }
        else if (canMove() && (statueArrowBottom.canMove() || statueArrowTop.canMove()))
        {
            Debug.Log("TWO_MOVE");
            two_move++;
        }
        else if (canMove())
        {
            Debug.Log("ONE_MOVE");
            player_only_moves++;
        }
        print("MOVE_TIME: " + currentMoveTime);
    }
Пример #2
0
    private void logMoveData()
    {
        //When a player moves, record the current time
        // when the player next moves, record the current time
        // subtract the previous move time from the current move time
        float currentTime     = Time.time;
        float currentMoveTime = currentTime - prevMoveEndTime;

        movementTime   += currentMoveTime;
        prevMoveEndTime = currentTime;
        if (canMove() && statueArrowBottom.canMove() && statueArrowTop.canMove())
        {
            all_move++;
        }
        else if (canMove() && (statueArrowBottom.canMove() || statueArrowTop.canMove()))
        {
            two_move++;
        }
        else if (canMove())
        {
            player_only_moves++;
        }
    }
Пример #3
0
    public void act()
    {
        if (players < NUM_PLAYERS)
        {
            if (moves > MAX_MOVES || isStuck() || victory())
            {
                logEndGameData();
                resetForNewPlayer();

                players++;
            }
            int randomTurn = (int)UnityEngine.Random.Range(0.0f, 4.0f);
            if (randomTurn == 0)
            {
                turnUp();
                statueArrowBottom.turnUp();
                statueArrowTop.turnDown();
            }
            else if (randomTurn == 1)
            {
                turnRight();
                statueArrowBottom.turnRight();
                statueArrowTop.turnLeft();
            }
            else if (randomTurn == 2)
            {
                turnDown();
                statueArrowBottom.turnDown();
                statueArrowTop.turnUp();
            }
            else if (randomTurn == 3)
            {
                turnLeft();
                statueArrowBottom.turnLeft();
                statueArrowTop.turnRight();
            }
            logMoveData();
            if (canMove())
            {
                move();
                moves++;
                if (statueArrowBottom.canMove())
                {
                    statueArrowBottom.move();
                }
                if (statueArrowTop.canMove())
                {
                    statueArrowTop.move();
                }
                Debug.Log("ADDED new state " + stateToString());
                if (!states_explored_list.Contains(stateToString()))
                {
                    unique_states++;
                }
                states_explored_list.Add(stateToString());
            }
        }
        else
        {
            finished = true;
            Application.Quit();
        }
    }