For today’s golf gameplay-related dev update, I’ve added automatic movement to the character, for reaching the ball and sort of positioning himself to take the shot!
It was easier than expected, thanks to some foresight of past Gus when coding the game. I simply moved the function to shoot the ball away from instantaneous execution after releasing the mouse button over the desired location, and put it in another action executed by the golfer character once it has reached the calculated point of shooting.
This calculation is a bit dirty now, as it only tries to get position slightly away from the ball and perpendicular to the direction from the ball to the desired target. For the current prototyping purposes it works.
The golfer also slightly delay the shot when he arrives in position, in order to “think” about how to hit the ball. I’ll add some animations and fluff to this step later.
You can see the execution of a hole with the new system below:
And that’s it for today’s update on golf gameplay! Still need to automate the moving to the ball more, so that the doesn’t wait for your to finish deciding on the stroke before taking position. And the shot visualizer thing is still broken, giving out NaN results depending on the slope. I’ll make a better fix for that later!
That’s all, folks! Keep on teeing! And may your strokes never slice!
(Also, starting from today, I’ll drop the numbered update from the format and put in a more relevant title off the bat. This will give you, readers, a quicker idea of what the feature is relevant to straight off the title. Categories like Golf Gameplay, Tycoon Gameplay, Management Gameplay etc will make it easier for navigation!)