The files I'm talking about hold the map data. Now, they only hold which images are on the map, which tiles show which images on them, and whether a tile is walkable or unwalkable, but I have more planned.
Quote: "
Because the files are going to be generated by a map editor, I really wouldn't worry about it. The best you're going to do is stop your program from crashing due to a corrupt file, and at that point what can you really do anyway?"
Good point, the checks are there so I can figure out where the file is corrupted, (if it is) but when my map editor is finished I'll just take them out. My program already is slow (I have an old computer), but that might also be caused by the file reader checking for syntax, skipping blank lines, skiping comments and extracting comma separated values from strings. Yes, I think I'll take those checks out once my map editor is done.
Quote: "If you declared them in a function, it would be better if you were deleting and making these sprites in the game because it'd be the easiest way to find a free number, but it would also be harder to keep track of ."
I think I'll go with using a function. I won't be constantly creating and deleting media; only when a new map is loaded. I don't want to have a huge list of all the images and their numbers like my FPS mini-game, so I think a dynamic system is the way to go.
I'm still concered about referencing them, though. The only way I can think of keeping track of sprites and images whose numbers are in no definite order is using an array to hold the numbers.
I already have serveral arrays, but I can't figure out how to use the stack/quene commands. Does anyone know a good tutorial on them?
Until I know how to use them I must make the arrays as a constant size, usually using more memory than is needed and slowing it down.
Thanks for your help!