Smart arrows: a bug fix & a design note


First, the bug: Player arrows didn’t seek phaser bullets!

Phasers are the enemies that see and shoot through walls. Since phaser bullets have to travel through walls, that bullet class has its own “hit group”, the ID that lets me tell the physics engine what things can hit what other things, so that it doesn’t have to compute a bunch of collisions that it’s going to ignore. For example, phaser bullets hit players, mines, blocks, mushrooms, and player fire, but not other enemy fire, powerups, or walls.

Anyhow, when I added that new hit group, I forgot to tell the player’s arrow’s vision system. Player arrows still hit phaser bullets. But the arrow’s rayscans didn’t, so arrows couldn’t see the bullets or steer into them, which made phasers even harder to fight than I’d intended. Oops! Fixed.


I wanted this to be an action game about timing and movement and direction changes, not careful aiming. And if you play with a keyboard, you can only quickly aim in 8 directions anyhow. So how was the player going to blast a bunch of enemies without precise aiming?

One solution is to have a weapon with a wide spread, like a sword-swipe or a shotgun. But I really wanted to have single shots, and no complicated enemy health, and also no killing a bunch of enemies with one shot. Sort of Mario-like, with simple one-step state transitions. And I wanted more distance than a melee weapon. Then I played Towerfall, and saw that heat-seeking arrows make up for imprecise aiming, so I went with that.

I also needed something that could steer away from walls and follow a wall’s curve, so the player doesn’t get frustrated by hitting walls, instead of the target they were aiming at. The arrows adjust their angle at the moment you fire, to avoid a wall even if you’re right up against it and aiming into it a bit. The player’s aiming direction is just considered a hint at what the player wants. Nobody wants to waste an arrow by hitting a wall, while surrounded by monsters.

At one point I messed around with making the arrows have a long-range option, but didn’t put it in the final game. I didn’t think it was that much fun to simply delete enemies from a huge distance - it was too easy. You can still mess with the missile distance in the gallery, in the “player fires” scene, and give them up to a 4x distance boost.

Files

fracas3.zip Play in browser
Feb 17, 2023

Leave a comment

Log in with itch.io to leave a comment.