I'm trying to create a map-system from which the player enters new levels.
My approach so far has been like this:
-Create a global variable for storing the number of levels passed
-Create doors on the map as instances of one door object
-Give the doors a boolean instance variable called "unlocked" and set it to False by default.
-Try to loop trough the doors and toggle the boolean if IID of a door is smaller than the global "levelsPassed" variable.
The last part is giving me trouble (and I'm not even sure if my whole approach to this map is a good one).
Here's what I tried for the loop:
Condition 1: For each door order by door.IID ascending
Condition 2: levelsPassed > door.IID
Action: Set unlocked to True
I'm still a newbie and that might be a very bad approach
So in a nutshell, what would be a good way to loop trough my doors and toggle their instance variables based on the number of passed levels?
Turns out I was making a simple mistake and was setting the boolean to false instead of true. So this actually works!!
I guess my only question would be that do you think this IID-dependency will give me trouble later on? Is there a smarter way to assign unique identifiers to the instances?