Game Mechanics - Bowling ball hook
This was trial by error at it’s best. This problem kept me up at night and step by step I coded until the solution was had. As seen above the player can rotate the ball on the Y axis between a clamped amount of -45 to 45 degrees.
This influences the amount of hook on the ball as it travels down the lane. The magic is all thanks to a editor extension called PathMagic no punt intended.
The code below shows how the 4 waypoints in lanePath are moved in proportion to the amount of ballSpin.y
Maybe not the most elegant looking code at this stage but I am planning on further refinements.
[(more to come)]
2 comments