Advanced Bullet Mechanics
Bullets are probably the most important element of gameplay, so it’s important to have a lot of options in place to give us the most versatility possible.
Acceleration#
Probably my favourite mechanic out of these, acceleration lends it’s way to things like lingering bullets or bullets that effectively shoot with a delay.
We want a few parameters:
- Acceleration delay: lets us delay the acceleration
- Acceleration rate: how much the bullet accelerates in tiles/second^2
- Acceleration limit: min/max speed, eg. 0 to stop the bullet and prevent it goign backwards.
Curve#
Changing the bullet’s direction after it’s been fired opens up very interesting patterns, and is something I don’t think is used quite enough in these kind of games.
Every update interval (each frame or a coroutine), we get the angle of the bullet’s velocity, adjust it and set the velocity back.
Area of Effect (AoE) projectiles#
A completely different type of projectile, one that flies over the ground and deals area damage when it lands.
Visual effects#
I’ve also added a few purely visual mechanics. Right now these are:
- Sprite rotation
- Spawn & Despawn animations
- Fade in/out
- Scale up/down
and I will probably add more later.