The enemies work as some sort of repelling magnets where the repelling force is greater the closer they are to another object. I thought it looked amazing!
Unfortunately, this technique was very inefficient and would cause a huge drop in FPS the more enemies you had in the level. So I have now settled on a different technique. The enemies now only look at enemies intersecting their bounding box and repel from them. This made the algorithm much much lighter and still kept the enemies from forming a single block, though the effect looks much less impressive.
So my first goal this week was achieved: keeping the enemies from forming a single block. Next up was actually being able to hit the enemies. Thanks to Unity, this was farily easy to do. I could simply shoot a block and check if it intersected with any enemies. If it intersected, I could simply destroy the enemy and that's it. But that wasn't enough. It looked boring and stale and the blocks you shot would go on forever piercing all enemies in their path. So it was time to make it a bit more fancy, which meant one thing: particles. I have constructed some fancy particles which follow the bullet around and make an exploding effect on impact. Also, enemies being killed now splattered into particles to make it a bit more satisfying. The effect looks like this:
You might also notice that the bullets slow down when they've hit an enemy. With every impact they slow down and below a certain speed they explode. That way, you can pierce your bullets through a few enemies. Once I had that I programmed the enemies to have varying speeds so that not every enemy would walk as fast as all the others. Finally, I added a different kind of enemy which would come at you in a wave-like pattern. That was initially a bug, but hey you know what they say: "it's not a bug, it's a feature!" and a feature it was. To make the game ready to be played I divided the enemies into waves and added a bit of a menu.
I kept my promise to you, so here it is: the first playable version of Cube Blast!
So what's next? Well, there isn't much of a goal yet. So I would like to add some kind of money system which you can use to buy and upgrade spells you have. Since it is a bit of a dominant strategy to hug the corner and shoot in both directions you should be encouraged to walk around a bit. So this is what I came up with:
The idea is that in the level a 'book' will spawn in a random location. You have to kill enemies within a certain range of these books to increase your currency with which you can buy/upgrade spells and abilities. I'll start working on that next week and we'll see where we'll end up.
For questions, feedback or requests I can always be reached at:
indiestepsblog@gmail.com





