Basically i have to make a maze game, sprites etc using SFML and C++.
Now I've made an array to create the grid and mannaged to show 0,1,2,3's for different items on the map and show that in the console. It's got to the point where i need to show the sprites in the positions of the numbers and in the sfml screen not to console.
Heres the code i have but it doesn't show any of the different types of walls
int gridArray[10][10] = {
{0,0,0,0,0,0,0,1,1,1},
{1,1,2,1,0,0,0,1,0,0},
{1,1,0,0,1,3,1,1,1,0},
{0,1,0,0,0,0,0,0,0,0},
{0,1,1,1,3,1,1,1,1,1},
{0,0,0,0,0,0,1,0,0,0},
{1,1,1,1,1,3,1,1,1,0},
{0,0,0,0,0,0,0,1,0,0},
{1,1,1,1,3,1,1,1,0,1},
{0,0,0,0,0,0,0,0,0,0}
};
int gridVar = 0;
for (int x = 0; x<10; x++){
for (int y = 0; y<10; y++){
gridVar=gridArray[x][y];
switch (gridVar)
{
case 0:
win.Draw(specialGemSprite);
break;
case 1:
win.Draw(wallSprite);
break;
case 2:
win.Draw(wallTraverseSprite);
break;
case 3:
win.Draw(wallGooSprite);
break;
}
}
}
This is all with in the draw function.
Any ideas why i don't get anything?
Thanks!

New Topic/Question
Reply



MultiQuote






|