Scipi
« on: 22 July, 2011, 19:46:20 »
0
I'm getting an error with some of my C++ code for Daemons (It's the last in a long list of errors preventing screenshots) and I have no idea how to fix it.
The error is: Game.Game::App does not have class type.
Here's the code for the creation of App
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
class Game { public: sf::RenderWindow App(); vector <sf::Sprite> SpriteFiles; void Setup(); void MainMenu(); void GetEvents(); void LevelUp(string, int*);//Daemon name, pointer to Daemon stats array Game(); ~Game(); private: bool FilesExist; stringstream PictureName; char ImageNum; vector <sf::Image> ImageFiles; };
And here's one example of it's usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
void Map::Display() { Game.App.Clear(); for (int y=PosY; y<ScreenHeight; y++) { for (int x=PosX; x<ScreenWidth; x++) { if (y >= 0 && x >= 0) { if (MapData[x + (y * MapWidth)] == -1) continue; Game.SpriteFiles[MapData[x + (y * MapWidth)]].SetPosition(x * 64, y * 64); Game.App.Draw(Game.SpriteFiles[MapData[x + (y * MapWidth)]]); } } } Game.App.Display(); return; }
Any ideas on how to get App to work? It has a class type (An sf::RenderWindow) which is a drawable window.
Logged
Spoiler for OldSig :
Imma Cat! =^_^=
(Make this an emoticon!)
Spoiler for IMPORTANT NEWS! :
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do... Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met. In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...
Munchor
«
Reply #1 on: 24 July, 2011, 15:40:39 »
0
How many files are there? Could you upload all of them and tell us how to compile please? That would make it easier for us to help you
Logged
Scipi
«
Reply #2 on: 26 July, 2011, 00:51:59 »
0
I found out what was going wrong. I had to remove the () from sf::RenderWindow App();
Logged
Spoiler for OldSig :
Imma Cat! =^_^=
(Make this an emoticon!)
Spoiler for IMPORTANT NEWS! :
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do... Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met. In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...