Update 12
A mix of stuff.
New Content
- Added the Mister Tiny.
- This minigun is sort of like a more accurate Prayer Sprayer. It fires 10 shots per second with a spread of 5 degrees that each deal 2 damage. It has 50 shots before taking 4 seconds to reload. However, this additional accuracy comes at the cost of your movement speed, which is halved when you fire it. Because your speed provides such a big advantage in fights, you're much more prone to taking damage. Careful positioning and dashing is key for this weapon.
- Added an enemy-exclusive healing gun.
- This healing gun fires healing beams at whoever the user's teammates are. However, because you have no teammates, you don't get this item. The healing gun fires 2 special green beams per second that heal 3 HP and it has 10 shots before taking 3 seconds to reload. These beams are 50% faster than your pistol beams. Because your damage can outpace the healing, you aren't absolutely required to take out healers before fighting the enemy being healed, though leaving them alive can lead to them keeping enemies alive for longer and possibly reversing the damage you dealt if you switch targets. If you end up between a healer and its patient, you can steal the healing for yourself. The healing gun is used by grunts.
- Added a wave system for combat rooms.
- This is pretty overdue, but enemies can now spawn in waves (shown in the gif). There's no spawning animation yet, but it's coming.
Gameplay Changes
- Enemies have a better targeting system. The old system was built with the playing being alone in mind. However, with the introduction of the healing gun, enemies could now have multiple potential targets. Because of this, I introduced a new system where if enemies detect multiple targets, they'll go for the closest one.
- Guns can fire inside of enemies again, so you don't need back away as often. However, they keep their inability to fire inside of walls.
- Enemy explosives have smaller radii since they're kind of a pain to dodge with the player's explosion radii.
Behind the Scenes
Here's the code for target choosing logic. First, the soldier gets a collection of all colliders of certain layers (groups), in this case the priority target layers, in its attacking radius. If it gets any colliders, it sets a base distance to compare to, then goes through every entry in the collection, ignoring itself if it detects itself. With each entry, it compares the distance between itself and the object and checks if it's lower than the previous shortest distance. If so, that object becomes the new target to compare to for future entries. If the soldier doesn't find anyone that isn't itself, it declares its target null (meaning there isn't one) then repeats this check for the non-priority target layers. If this second check fails, the soldier will not have a target at all, so it just goes about its day instead of trying to shoot the target.
Note: This code may contain bugs, so be careful if you copy it for yourself.
Overall, a pretty good two weeks. Not much to say that hasn't already been said.