Lessons learned with Godot mouse collision detection, plus crow and polish updates


Today we released an update to Farmhand Go! that brings a few pieces of polish along with some technical improvements to the crows. The crows were something we received several consistent comments about with the initial version of the game. They could be a little tricky to interact with because the mouse kept wanting to give focus to the plot underneath the crow.

We tried out a few different approaches to solving this. We are building this game with Godot and felt like the crows should naturally take precedence with collision handling due to them being a higher z-index, and also their collision areas having a higher priority over plots. However, what we expected wasn't what we were seeing when we played the game. So, we came up with a totally different approach. 

The solution we came up with actually involves a "projectile" which is used to handle damaging the crow. The projectile is not visible to the player at all, and doesn't even move through the game world, it is simply created where the mouse is clicked and removed a millisecond later. It is nothing more than an Area2D node on its own unique layer. The crows are the only other thing on this layer, so the collision detection is straightforward now, and much more reliable!

While working on the crows we decided to polish a few other things about them. They were lacking an animation for when they have landed on a crop and are attacking it so we whipped one up. We have also been playing with Godot's Particles2D in another project and decided to put it to use for some playful smoke particles when destroying a crow.  We'd love to hear feedback about all these crow changes if you have any!

Some other polishing we did was in the main menu area. The options menu font was updated, and the option to mute all audio was split apart to allow sound effects to be muted separately from the background music. The 'select your farm' screen also received a makeover that we think looks pretty great!

Lastly, we felt that one of the problems newcomers to the game might have had is that we didn't explain the controls anywhere, nor did we explain how to play the game outside of the short tutorial. So we added a ton of information to the main Farmhand Go! page to cover all of this. Let us know if you think of any information that seems to be missing still though. 

Thanks for reading and happy farming!

Leave a comment

Log in with itch.io to leave a comment.