Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

Wow, this is super impressive, you basically just submitted a finished and highly polished game. The player character was a bit sus for a moment, if you know what I mean. I would like to know how you glued the character to the platforms and changed gravity. Was it complicated to implement?

(+1)

Thanks for playing! Really happy you enjoyed it so much! 🙂

 So, to say the truth, the way I glued the character isn't really elegant, and I think there are better ways to do it hahaha anyway, here's how it was done:

  • The idea is that there's a function that every frames checks just ahead of the player for a floor or a wall. It also checks the following:
    • If the player jumped. It this is the case, no rotation happens (otherwise the player could accidentaly spin around while jumping);
    • It the player isn't walking, no rotation happens (the player MUST be wallking to loop around the terrain);
    • If the player spin animation wasn't finished, no rotation happens (this one is a bit janky but helps preventing the player from being ejected while rotating);
  • If everything is fine, then the function makes two checks:
    • First, it checks if just ahead of the player there is a wall and there is a floor. If that's true, then the player must be just before a wall, so it should rotate to climb it.
    • Otherwise, the codes checks if just ahead of the player there ISN'T floor, but last frame there was. This means that the player is just before a ledge, so it must rotate to be kept glued to the terrain.

 So, there's some repeat checks here and there, but it works.

 Also... I don't actually change the gravity directly when rotating: instead, I change the floor normal. The reason is that this way I can make the gravity change and rotation animation smoother!

 The biggest problem was making the animation smooth. Initially the player just snapped to the new floor, and it was quite rough on the eyes hahaha, but with some tweens, trial and error, and a bit of angle math, it ended up looking as it is right now.

 Feel free to check the source code as well, it's on the game page. Thanks again, glad you thought so much of our game!

(+1)

Thanks for your reply, I guess changing the floor normal is a clever and simple solution in Godot. Good luck in future jams!