My latest tutorial about Spring Ninja has been one of the most popular post of this year, unfortunately most of the feedback received both through comments and private messages was about a bug I really was not able to reproduce, but I think I found a solution anyway.
To check if the ninja is on the top of a pole, in the original script at line 101 I wrote:
p.y is pole vertical position, which has the vertical registration point is on the top of it.
n.y is the ninja vertical position, which has the vertical registration point in the middle of it, that’s why we add
n.height/2. This ensures us the ninja is on the top of the pole but also can lead to a bug if ninja or pole positions aren’t pixel perfect.
If you change the line with
Which checks for the ninja to touch its bottom side, the bug should be fixed.
Try to change this line and let me know.