Exemplo n.º 1
0
    void PutBomb()
    {
        int row    = 0;
        int column = 0;

        do
        {
            row    = (int)Random.Range(0, 11);
            column = (int)Random.Range(0, 11);
            if (row % 2 == 1 && column % 2 == 1)
            {
                column++;
            }
        }while(DestructibleMap.Map(row, column) != 0);
        DestructibleMap.AddBombOnMap(row, column);

        Vector3 positionBomb = new Vector3(row - 4.5f, -column + 4.5f, 0f);
        Vector3 test         = Vector3.zero;

        Instantiate(bomb, positionBomb, Quaternion.identity);
    }
Exemplo n.º 2
0
    private int ExplosionCheckRight()
    {
        if (Math.Min(rangeOfFire, 10 - bombPlacement.x) == 0)
        {
            return(0);
        }
        int i = 1;

        while (i < Math.Min(rangeOfFire, 10 - bombPlacement.x))
        {
            if (DestructibleMap.Map(bombPlacement.x + i, bombPlacement.y) == -1)
            {
                return(i - 1);
            }
            if (DestructibleMap.Map(bombPlacement.x + i, bombPlacement.y) >= 1)
            {
                i++;
                return(i);
            }
            i++;
        }
        return(i);
    }