I've got a project where the player can walk back and forth between areas (frames), just like Zelda or Metroid.
Now I want to store the enemies that have been killed, so that the player won't have to fight them again each time they walk back and forth between areas.
I do this by giving each enemy an ID and adding that ID to a list or array. Then I destroy that enemy when the frame loads and its ID is present in the list or array.
The enemy ID is set from its "fixed value". I thought this value would always be unique, but I guess it is not when I load different areas from external files into the same frame.
Are there any tricks to keep the fixed value unique in this case?
I could add a second set of numbers to the enemy ID based on the different areas, but this would add another layer of complexity I would like to avoid if possible.