SMFL sprites and grids help!

Hi guys, ive got a bit of coursework that im stuck on!

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

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
void gameSetup::draw()
{

	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;
				}
			}
	}


	win.Clear(sf::Color(56,56,230));

	playerSprite.SetPosition(b.getPosX(),b.getPosY());
	win.Draw(playerSprite);

	/*enemySprite.SetPosition(c.getPosX(),c.getPosY());*/
	win.Draw(enemySprite);

	win.Draw(gemSprite);


	
}


This is all with in the draw function.

Any ideas why i don't get anything?

Thanks!
Topic archived. No new replies allowed.