Sunday, August 5, 2018

health powerups (re: dammit I love this engine)

I was looking at the todo list, looking for some low hanging fruit, as it's already been kind of a long I decided to do two things: add health powerups and increase the pickup radius for powerups, in general.

Time from start to finish: less than 5 minutes.

And that included time making a bouncy red "H" sprite to act as a placeholder for the graphic. (All of the powerup graphics will be remade once I figure out how I want to do them.)

Basically, it went like this:  First I created a health powerup object. It doesn't actually do anything except wander around and bounce, the code for which is already part of the generic powerup code. Then, I opened up the player object, created a new collision event which checked to see if the player collided with  a health powerup. If it was, add the value I put in the variable "health_powerup_health" to the players health, and destroyed the powerup. Then I added the health powerup to the drop table for dead enemies. The value of the variable "health_powerup_health" will, of course, be determined by the difficulty level. Once I implement difficulty levels.

While I was at it I increased the size of the collision mask for all of the powerups, which effectively increases their pickup radius. I may need to do that again. Play testing will tell for sure.

Five minutes. And this wasn't even with code that will need to be refactored later because it sucked.
I'll be refactoring the powerup drop mechanics later anyway, but only as part of a design pass - there are certain things I haven't decided on yet: do I limit the number of powerups that can drop? Do I go ahead and leave that be since you sometimes get really unlucky and nothing drops? Right now, an enemy could, in fact, drop one of everything as each powerup is check separately.

I'll probably set a standard drop rate of like 50%, and then make it so that each dead enemy only drops one powerup 99% of the time. For the last one percent, they'll drop something else too. The game relies very heavily on drops to ramp up the action. I've already lowered the overall drop rate, and I'm not happy with the results. My initial thought was "too many powerups on the screen", so I lowered it. Now, I sometimes struggle to get through the first minute of the game, especially when the RNG hates me.

Unless I'm playing the UFO with the missile rig, which is seriously just easy mode right now. That thing really needs to be nerfed.

It took me longer to write this post.