Talk:RPG MAP2
From GPWiki
The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server. However, the GPWiki forums are still active! Come say hello. There is only one thing I didn't grasp or rather understand how to do in this tutorial. The following line: Read MapWidth, MapHeight How can I translate that into C++ so MapWidth takes up the MapWidth value and MapHeight takes up the MapHeight value from the file? // this code indeed compiles but it doesn't work as the Read function does it seems std::ifstream lev("level.txt"); lev >> LevelWidth, LevelHeight;
3 3 0 0 0 0 32 1 32 0 0 32 0 0 0 0 1 0 0 0 0 32 0 0 32 1 32 32 0
int LevelWidth; int LevelHeight; std::ifstream lev("level.txt"); lev >> LevelWidth >> LevelHeight; |


