Final day!
A bunch of stuff coming together at the last-minute as usual. I’ve added an “endless” mode to meet the jam requirement. The “seamless” requirement is that you start where you ended. In a way, Guerilla Gardeners already meets that requirement since you never leave the garden/farm. But the constraint also drove us to start and end in the spring even if a more natural cycle would probably end on autumn.
But now the seasons are nearly completely absent from our little game. We didn’t have capacity to make different backgrounds and other art to represent each season and without those, the season-based mechanics are hard to understand.
Another big change was adding scores. One of the optional constraints for the jam was to have no numbers. I had hoped that the prosperous piles of produce would be enough of a signal but in the end, the game loses a lot by not showing the score and importantly, the different values of each crop.
So the sign board originally used to display seasons got repurposed to display the score.
…
Minor tip: Ctrl + P opens any file. Ctrl + Shift + O opens only scenes. I almost always have to type “tscn” into the Ctrl + P search box to ignore the GDScript with the same name as the scene. This will streamline things yay!
…
There’s an interesting problem where I want a sound to play when I pick something up. The issue is that the item is removed from the scene when the sound should play so I can’t put the sound in the item. I could put it on the player but it’s poor design to have the Player class hold the sounds for every item they pick up.
I guess one solution is to instantiate a new AudioStreamPlayer3D, place it where the watering can was, and have it play the sound. But then I lose the editor UI for tweaking the sound. Keeping a scene for each sound that’s placed this way seems like a lot of overhead but might be the way to go.
Interesting.
…
Another interesting one. When the game is over and I unload the scene, the hit areas trigger body_exited events on all their contents. In my case, the ScorableArea unloads all the crops inside. This is bad because the scene is in a state of being partly removed. In particular, my get_viewport().get_camera_3d() returns null.
Rather than guarding against the camera being missing, I should make a check in the body_exited handler.
A little discussion on the topic here: https://github.com/godotengine/godot-proposals/issues/6237
I tried various quit detectors and scene tree exiting and queued for deletion checks but none of them worked. So when the game is over I set a flag and my ScorableArea reads said flag and ignores any body exits.
It works.
…
Well. We did it! Released the game and submitted to the jam. Phew!