I'm currently working on a top-down shooter, and have reached a "hmm, I'm doing something terribly wrong" point. Basically, here's what I'm trying to accomplish:
- I'd like to allow the programmer to hard-code in the map (I don't understand how to make a tile editor yet, need to familiarze myself with WPF prior to beginning that project) so that it can be loaded into application for later use. This has been accomplished.
- After the map has been created, I alter the code so that I can load the map and draw the contents of it. Essentially, if there's a 0 in the text file, draw the grass tile. If there's a 1, draw the dirt tile, etc.
- I'd like to have mulitple worlds so that if the player goes to a certain location (for instance, they step over the left side of the screen), then the world will change entirely. Think of the old Zelda games.
The problem is that when I load the text file and draw the world to the screen, I receive extremely bad framerate lag. I've tried altering the source a bit, but now the world doesn't even draw. I've attached a zip that contains the project's code and assets. I'm looking for any type of suggestions with creating and loading tiled maps using C# and XNA. In case you don't wish to download the project, I went ahead and included three source code files which are likely the cause of the issue to this post.
WARNING: MY SOURCE CODE IS REALLY MESSY AT THE MOMENT!