System Programmer creating fun out of chaos

This morning I spent polishing the random level generation.

Yesterday the platforms generated where too much disconnected. I wanted them to connect more so the textures will look more interesting in the end. Turns out: the code was not optimized to identify each platform using their coordinates. That were just randomly put in a list without order. I had to program code to make it possible to identify platforms by their position in the level. Eventually it worked, using that code I made some more functions that return the offset of the neighbors in blocks.

So, for example: a platform has a platform 2 blocks above it. If you call that function asking for the nearest top neighbor it will return 2. This is very useful. I made a heatmap deciding where to connect the platforms using that code. I realized I could reuse the same code to add power ups, so I did! Now it is time to add enemies. I want to have several enemy types: circling enemies, walking enemies and stationary enemies. If I have time I'll let them shoot too! You have to avoid the enemies, maybe I'll add code that you can kill them by jumping on top, but only if I have time.

As you can see the levels are built out of blocks. That will change, I just wanted to have the functionality right (and I'm procrastinating creating graphics haha).

You can play nightly build here.