public string move()
    {
        if (dataCollector != null)
        {
            dataCollector.AddMove();
        }
        else
        {
            Debug.Log("Warning: DataCollector not found in scene.");
        }

        transform.Translate(direction * 2f * boardScalingFactor, Space.World);
        //num_traversed_squares_player++;
        string predictedSquareName = coordinatesToSquare(predictedSquare);

        Debug.Log("MOVED TO " + predictedSquareName);

        pathTrace += "-" + predictedSquareName;

        Vector3 oldSquare = square;

        square = predictedSquare;

        /*
         * if(!squares_explored_player_list.Contains(predictedSquareName)) {
         *      squares_explored_player_list.Add(predictedSquareName);
         * } else {
         *      num_repeated_squares_player++;
         * }
         */
        predictedSquare.x = 2f * square.x - oldSquare.x;
        predictedSquare.y = 2f * square.y - oldSquare.y;
        return(predictedSquareName);
    }
Esempio n. 2
0
    public string move()
    {
        dataCollector.AddMove();

        transform.Translate(direction * 2f * boardScalingFactor, Space.World);
        string predictedSquareName = coordinatesToSquare(predictedSquare);

        Debug.Log("MOVED TO " + predictedSquareName);

        Vector3 oldSquare = square;

        square = predictedSquare;

        predictedSquare.x = 2f * square.x - oldSquare.x;
        predictedSquare.y = 2f * square.y - oldSquare.y;
        return(predictedSquareName);
    }
Esempio n. 3
0
    public string move()
    {
        if (dataCollector != null)
        {
            dataCollector.AddMove();
        }
        else
        {
            Debug.Log("Warning: DataCollector not found in scene.");
        }

        transform.Translate(direction * boardScalingFactor * 1.25f, Space.World);
        string predictedSquareName = coordinatesToSquare(predictedSquare);

        GameObject.Find("block" + predictedSquareName).GetComponent <SpriteRenderer>().color = Color.yellow;
        //resultStr += predictedSquareName;
        Vector3 oldSquare = square;

        square = predictedSquare;
        Debug.Log("Moved to " + coordinatesToSquare(square));
        pathTrace += "-" + predictedSquareName;
        int col, row;

        if (predictedSquareName.Length > 2)
        {
            col = Convert.ToInt32(predictedSquareName.Substring(0, 2));
            row = Convert.ToInt32(predictedSquareName.Substring(2, 1));
        }
        else
        {
            col = Convert.ToInt32(predictedSquareName.Substring(0, 1));
            row = Convert.ToInt32(predictedSquareName.Substring(1, 1));
        }


        squares_explored[col, row] = true;
        obstacles.Add(predictedSquareName);

        predictedSquare.x = 2f * square.x - oldSquare.x;
        predictedSquare.y = 2f * square.y - oldSquare.y;
        return(predictedSquareName);
    }