Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
fixed some issues.
  • Loading branch information
s403o authored Dec 17, 2019
1 parent 5866fd9 commit 5e63be9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ void DrawFood()

void randomm (int &x, int &y)
{
int maxX = gridX - 2, maxY = gridY - 2; //from 1 to 38
int maxX = gridX - 2, maxY = gridY - 2; //from 0 to 38
int minn = 1;
srand(time(NULL));
x = minn + rand() % (maxX - minn);
y = minn + rand() % (maxY - minn);
}
Expand All @@ -159,7 +158,8 @@ int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); //swap buffers (display && work)
glutInitWindowPosition(2000, 2000);
glutInitWindowPosition(500, 150);
glutInitWindowSize(1024, 600);
glutCreateWindow("SNEAKY!");
glutDisplayFunc(DisplayCallback);
glutReshapeFunc(ReshapeCallback);
Expand Down Expand Up @@ -220,4 +220,4 @@ void KeyboardCallback(int key, int, int)
}
}

//################### main #######################
//################### main #######################

0 comments on commit 5e63be9

Please sign in to comment.