Solved LibGDX Random Coin Placement

Ahoy!

I am having a bit of a hard time figuring out how to randomly place a coin based on !null tiles on a tilemap layer. Here is what I have at the moment:
For loop through the tile maps width and height, check if cell is null, if it isn’t place a coin there.

This, of course, only runs once and places the coin at the last position it can. What I want is for it to place one in any !null tile on the layer. How can I achieve this?

My method is “populateCoin”.

Thanks!

  • A