I'm looking for some idea's how best to store spawn information for a side scroller. The game I'm writing is very similar to Super Mario Bros. What I'm trying to implement is as you move through a level, enemies should spawn at particular locations. I want to store this information in the level and I don't want to just randomly spawn enemies. I'm looking for a high level strategy to store and retrieve the spawned objects when the player reaches a particular location (like mario). I couldn't find any decent tutorials or suggestions from Googleing around.
The Level is tile based so the map is Tile[][]. Each tile right now is 16x16 pixels.
The only good suggestion I've seen so far is to store the the spawning information in a 2d array where the first dimension is x and the second is y, given in tile space. The issue I have with that implementation is that if my player is at say (160, 0) I want to spawn a particular enemy. If however next time the level is reset the player is at (160, 5) I want to spawn the same enemy. So for that implementation to work I have to do a scan for a given y position.
I'm looking for a more efficient storage mechanize. I need something where I can retrieve the correct spawns quickly and not waist too much memory storing spawning locations.
Are there any common strategies in games for this?