Exemple #1
0
    public God()
    {
        life = 5; score = 0;
        isCrash = false; isTurn = false;

        MainMatrix = new nodeM[Constants.MAT_W, Constants.MAT_H];
        for (int ii = 0; ii < Constants.MAT_W; ii++)
        {
            for (int jj = 0; jj < Constants.MAT_H; jj++)
            {
                MainMatrix[ii, jj] = new nodeM();
            }
        }
        Snakes = new snake[Constants.NUM_SNAKES];
        for (int ii = 0; ii < Constants.NUM_SNAKES; ii++)
        {
            Snakes[ii] = new snake();
            Snakes[ii].id = ii;
        }
        snakeBool = new int[Constants.NUM_SNAKES];
        for (int ii = 0; ii < Constants.NUM_SNAKES; ii++)
        {
            snakeBool[ii] = 0;
        }
    }
    public God()
    {
        life    = 5; score = 0;
        isCrash = false; isTurn = false;

        MainMatrix = new nodeM[Constants.MAT_W, Constants.MAT_H];
        for (int ii = 0; ii < Constants.MAT_W; ii++)
        {
            for (int jj = 0; jj < Constants.MAT_H; jj++)
            {
                MainMatrix[ii, jj] = new nodeM();
            }
        }
        Snakes = new snake[Constants.NUM_SNAKES];
        for (int ii = 0; ii < Constants.NUM_SNAKES; ii++)
        {
            Snakes[ii]    = new snake();
            Snakes[ii].id = ii;
        }
        snakeBool = new int[Constants.NUM_SNAKES];
        for (int ii = 0; ii < Constants.NUM_SNAKES; ii++)
        {
            snakeBool[ii] = 0;
        }
    }