Activity

daringcuteseal

The player’s swinging physics that I previously made with Godot’s built-in PinJoint2D was janky and there was no option to change the hook’s string length during runtime. Or, well, at least in an elegant manner. It is technically possible but the game would then need to rely on an implementation detail which is obviously not stable.

With this manually implemented physics, the hook’s string length can be altered freely. The swinging work by snapping the player’s y-axis position to the correct position, given we know the string length and the player’s x-distance from the hook. Linear interpolating the snap makes everything run smoother. The thing is, I wasn’t able to get the kind of swing motion I wanted right away, but I think this works fine as well (and in my opinion looks great too).

TIL: watch out for negative numbers in square root as doing so will result in NaN which won’t be reported to the Godot console.

0
daringcuteseal

I imported some assets for the game to Godot and worked on the player movement. For the hooking motion of the player, I initially did some of the physics manually by snapping the player’s y-position to the correct position. However, this turned out to be severely unnatural. I then used a PinJoint2D between a proxied player RigidBody2D that only gets activated when the player is doing a swing. Now that I think about it, a simple y-axis snapping may also work, so I’d have to try that later.

0