Hi everyone, I've checked, probably 5 or 6 arrays tutorials and also all the arrays related stuff in the "How do I" topic by Kyatric but I haven't found the solution for my problem.
I have an 2D array filled with monsters. Here's an example :
(0,0) "Blue Slime" //name
(0,1) 1 // level
(0,2) 3 // HP
(0,3) 1 // XP
(1,0) "Red Slime
I also have a monster sprite will all animation frame setted to 1 monster visual.
Frame 0 for Blue slime and Frame 1 to red slime here.
I want to spawn one any of the level 1 monster in my array. In this case both Blue Slime and Red Slime can be spawned since they are both level 1. To have the right visual I want to changed the animation frame of the sprite related to the monster.
So, how can I find all Level 1 monsters in my array (for instance I have 89 monsters in it) and choose one of them at random and spawn it by switching my sprite animation frame related to the monster chosen?