Reworking the Coin Spawn Code
Day 087 #100DaysOfCode
Day 051 #100DaysOfGameDev
![](https://i1.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/03/IMG_20200308_132019839-scaled.jpg?fit=800%2C600&ssl=1)
While I previously got coins to spawn into my game, it wasn’t quite how I wanted it to work. I spent a lot of time going over the code, specifically the math algorithms and ended up reworking everything from the ground up using what I had learned from the first try. This time I got something that was more like what I was looking for.
![](https://i0.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/03/2020-03-07notepad_script_PostPool.png?resize=800%2C587&ssl=1)
![](https://i0.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/03/2020-03-07notepad_script_CoinSpawn.png?resize=800%2C555&ssl=1)