I am currently working on a Megaman X-type game, with multiple weapons, each having its energy gauge;
When you get an energy pick-up, and your weapon energy is already full, it picks the weapon in the list that has the lower energy quantity and recharge this one instead;
Until then I used objects by checking which one has its variable the nearest to 0, but I wanted to know if there is a way to do the same by comparing values in an array, and retain the X index of the cell that contains the nearest value to 0?
Thank you for your time ~