I working on making a bestiary in my game. The idea is to push a button and a new layer becomes visible and gets populated with monsters you have obtained.
On this new layer I have 5 boxes called beast box. each has a instance variable called box_id
All my monsters have an instance variable called mob_id and are part of a family called mob_family. I also have an array for the monsters called array_monsters where I store the mob_id at position (0,1) for each monster. (3 monsters so far so 3 arrays are created)
What I want to happen is check each monster box id and match it to the correct monsters array.at(0,1) and spawn the appropriate monster in the box. (Box ids start at 0,1,2,3,...) (Monster ids start at 0,1,2,3,...) as well So If box id = 0 & mob_id = 0 spawn a badguy in first square, etc.
What happens now is I press 'B' My layer shows up, and the first 3 boxes get populated with random monsters from the family instead of my intended order of 0,1,2 (bad guy, slime, goblin)