What's wrong?
I'm making a simple Snake game in SDL, but when i'm making the grid isn't supposed to go like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
void SnakeGame::SetGrid()
{
SDL_Rect filler{0,0, 16, 12};
for(int i = 0; i < 64;i++)
{
for(int j = 0; j < 64; j++)
{
if(grid[i][j] == Nothing)
{
SDL_SetRenderDrawColor(mainred, 0, 255, 0, 255);
SDL_RenderFillRect(mainred, &filler);
filler.y+=filler.h;
}
if(grid[i][j] == Food)
{
food->myfood.y*=12;
SDL_SetRenderDrawColor(mainred, 0, 0, 255, 255);
SDL_RenderFillRect(mainred, &food->myfood);
std::cout << food->myfood.x;
}
}
filler.y=0;
filler.x+=filler.w;
}
}
|
http://a.pomf.se/xcsekx.PNG
Topic archived. No new replies allowed.