New Enemies



I wanted to dedicate this week to new enemy designs, since I haven't added any for a while. This also devolved into updating some of the existing sprites and code to be up to the standards of the more recent designs.




EXPLOSIONS

A big part of that has been having them do something more interesting than just disappearing when they die. Asteroids is half momentum and half explosions, so let's not neglect the explosions. This means new destruction sprites for each object type, as well as debris. Now that most destructible objects break apart, the amount of flotsam on screen has escalated. Many of these are not considered to be 'solid objects' by the code, which is the parent I use for the asteroids, and most anything else that can take and cause damage but isn't an enemy (objects in GM can only have one parent, and actors for the various factions need to have their own parent objects for complicated reasons). This is mostly important because it means they will not cause damage to objects that run into them. So the player can run into these little chunks of stuff without worrying about bouncing or taking damage.

This means that it needs to be obvious which objects need to be avoided, and which ones are okay to run over. The general rule is to keep the outlines of any objects that cause damage brighter than those that don't. For example, the inconsequential bits of a destroyed object are one or two shades darker than the object itself, and I made the small asteroids (which do cause damage) lighter so that they would stand out more (having a border that is only one pixel wide makes them look darker, even though they aren't).

When I initially set out on this project, one of my goals was to maximize readability. For any semi-literate player, I wanted it to be clear what the function of any object was at a glance. So far, there are three different factions in the game, and I wanted to confine myself to a single color per faction. All inanimate objects would be grey, the player red, all rebels orange, all company ships green, etc. This was also one of the main reasons to go with wire frames instead of filled sprites. Obviously, I've made numerous compromises, mostly in the name of aesthetics. The company ship was very boring to look at. So now it has a grey border, green windows, etc. The general trend is still there, faction colors are still a thing, many objects still have grey borders; but allowing more color variety definitely makes things look better. Jazzing up the block sprites a couple of weeks ago really drove that home.


MISSILE BOAT

Currently working on a more complicated enemy that fires missiles in salvos. I remember trying and failing to get something similar working in my original prototype, so it's satisfying to get it working well this time around. Before, I had trouble getting animations to start and stop at the right time. This thing needs to decide it wants to fire, then it needs to open its doors, then load missiles, then fire.

Here's what that portion of the code looks like, from just the step event:






Takes up a lot of space, but is actually less complicated than I was expecting.

Here is a dumb clip of what it was like before adding all that stuff:



There are still a couple of sound effects to add, and maybe some improvements to the sprite. Somehow, I always decide that the base sprite needs more detail after I've already added multiple frames of animation. Oh, and I still need to make debris parts for it. Right now, it just explodes into parts of the other large ship type, since I just reused a lot of the same code.

Of course, I also needed to make a missile object, and tune that to function how it should. When its timer reaches zero, it starts looking for an enemy in range, then permanently locks onto the first one it finds (prioritizing the player, I think). From that point, it will explode if it gets within range of the target, or if it collides with anything else. It can also run out of fuel, in which case it will just drift in whichever direction it was headed.

My favorite 'feature' of the missile is kind of an accident. I gave its explosion the solid object parent, which means that anything touching it will try to bounce off of it. The bounce function freaks out if it finds itself in the middle of a sprite because it keeps trying to bounce every step of the collision. Since the explosion expands so rapidly, it traps the object inside it for a few steps. Normally, you can't tell, because the other object will be destroyed anyway. But if the player has his shield up, he doesn't take any damage, so the explosion just causes him to freeze in place for a fraction of a second. I kind of liked how that looked, so I filled in the shield sprite to make it look like it was glowing during the collision, as if the explosion is affecting it. Looks cool and feels natural, I think. You can see the result in the first video.


ANEMONE ENEMY

The other new enemy is my current favorite, also seen in the video. That's this guy:




Unlike other enemies, it only aggros on the player, and other objects won't attack it until it does. To get that working, I had to add a 'Detectable' variable to every object. Which is nice, because now I can easily flag any particular instance to be ignored if I need to.

Tuning this enemy was a bit difficult, but I like the results. This is the first enemy that doesn't actually target anything, just fires in random directions constantly. However, if it is close to the player, its fire rate will constantly increase. Once that passes a certain threshold, it will overload and explode on its own, which was almost necessary to keep the player from needing to drop their shield in the middle of a cloud of projectiles. And this gives the player an additional incentive to deal with them quickly, before they fill the whole room with projectiles. Also, they scream and sometimes bleed when they die, so that's fun.

There are still one or two new designs on the list after this, though I was hoping to dedicate this week to adding new weapon types or powerups.....







 

Comments

  1. Your game is looking really good so far. The debris and explosions are especially impressive.

    ReplyDelete

Post a Comment