Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Aug 2011
    Location
    Romania, Bucharest
    Posts
    5

    Compilling error from lesson: 3DBuzz - C++ - Issue 3 - 7 Level (Using VC 2010)

    I am having a hard time with this errors:

    Error 1 error C2065: 'y' : undeclared identifier d:\diverse\lucru\visual studio 2010\projects\evilmonkeys\evilmonkeys\level.cpp 42 1 evilMonkeys
    Error 2 error C2065: 'y' : undeclared identifier d:\diverse\lucru\visual studio 2010\projects\evilmonkeys\evilmonkeys\level.cpp 42 1 evilMonkeys
    Error 3 error C2065: 'y' : undeclared identifier d:\diverse\lucru\visual studio 2010\projects\evilmonkeys\evilmonkeys\level.cpp 44 1 evilMonkeys
    Error 4 error C2065: 'y' : undeclared identifier d:\diverse\lucru\visual studio 2010\projects\evilmonkeys\evilmonkeys\level.cpp 48 1 evilMonkeys
    Error 5 error C2065: 'y' : undeclared identifier d:\diverse\lucru\visual studio 2010\projects\evilmonkeys\evilmonkeys\level.cpp 49 1 evilMonkeys
    Error 6 error C2065: 'y' : undeclared identifier d:\diverse\lucru\visual studio 2010\projects\evilmonkeys\evilmonkeys\level.cpp 51 1 evilMonkeys


    -----------------------------------------------------------------------------------------------

    The error comes from this part of the code:

    void Level::createLevel(void)
    {
    for (int x = 0; x < width; x++)
    {
    for (int y = 0; y < height; y++);
    {
    int random = rand() % 100;

    //the error is starting on this line with the first 'y'
    if (y == 0 || y == height - 1 || x == 0 || x == width - 1)
    {
    level[y][x] = TILE_WALL;
    }
    else
    {
    if (random < 90 || (x < 3 && y < 3))
    level[x][y] = TILE_EMPTY;
    else
    level[x][y] = TILE_WALL;
    }
    }
    }
    }

    -----------------------------------------------------------------------------------------------
    I am using Microsoft Visual Studio 2010 and everything worked perfectly until I got this error. I searched all the files in the project for a fix, and saw for about 4 or 5 times the lesson again, hoping to spot something wrong, but I did it exactly like in the lesson. I don't know if it's a error from using a newer version of Visual Studio or because of me.

    Please some one help, because if I can't fix this error, I can't finish the EvilMonkeys lesson and project.
    (I have also attached an screenshot with the problem in VS2010, maybe it helps more)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	VT2010error.jpg 
Views:	55 
Size:	281.1 KB 
ID:	72551  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •