My game has ending badges. I've set up arrays to keep track of what badges are unlocked. These are images, and I've figured out how to save them to an array. What I'm not finding is the syntax for pulling them out of the array, to display them. <<print>> gives me a list with commas, which I don't want. I'm not seeing a built-in function, so I'm poking into building my own, but is there an easier way to do this?
Comments
Regardless. That should be a fairly easy task. That said, however, without knowing a) how the images are stored within the array and b) how you want the final output formatted, save that you do not want a comma separated list, it's difficult to offer specific suggestions.
As but one example. If they're stored as image markup that you simply need to print, then something like the following should put you on the right track: (assume that the array is named $badges) SEE: <Array>.join() method.
My array is $badges_list, and I do just want them to print. I have a flexbox set up to handle how they display, so that's what I needed. Thanks!