Sonic Blast

The end is near and now it seems like the only thing I do is to try and fix, clean up or rework the different crazy and broken programing solutions in our game. It’s early pre-alpha code, dressed up for alpha, repainted for beta and now we are having the great task of deciding how much to fix with just duct tape and a paint job and how much we need to fix “for real”.

One of the many things that has been getting my attention this week is our “sonar blast”. This is when the bat unleashes a powerful wave of sound that destroys most of the obstacles in its path.

This is one feature of our game that hasn’t been getting that much love and attention from us. Mostly because it’s just a solution to bypass the projectile requirement. But when the game is starting to look better the contrast of our crappy sound wave sticks out really bad.

The way it worked in the beta was that whenever the player pressed space five objects (each with an individual id) with the wave-sprite would spawn on top of the player. The first wave object would start right behind the bat and from that object the rest was created with an increasing horizontal offset. Making them look like some type of wave. After spawned these waves would travel to the right on the screen and increase in size. The visual effect of this was okay but definitely not good enough.

The reworked version still has the five wave segments but I made some changes to enable me to control each independent of each other. So now the bat has a timer that enables me to spawn each segment at different times. This means that when the sonic blast is activated it spawns one small wave segment in front of the bat that grows over time. Then every 9 frames four times the rest of the segments are spawned in the same way, one at a time. This gives the effect of a growing cone-shaped wave that is smallest towards the bat and biggest on the opposite side.

The look of it is pretty much how we wanted it now but I still have some problems with the collision boxes of the wave segments. I’m trying to achieve a synchronized scaling of the collision boxes that follows the sprites scale but somehow, however much I try correcting it with my mighty shotgun the boxes keeps getting out of sync with the sprites. This is probably the result of three programmers working on top of each others codes so somewhere there will be a small bug-ghost hiding from 3-4 weeks ago. Most likely this will not be solved in a great way in the final game. Just as long as the player feels like the sonar blast is working correctly I’ll leave it. So much to fix, so little time.

Lämna en kommentar