Skip to main content

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

Cute game! I love the bear movement. How was it done??

Thank you! I'm so glad you enjoyed the movement, it's a little complicated 😅. Basic overview is:

  1. Head rotates toward mouse position
  2.  player position turns toward head's rotation while moving
  3.  current speed is determined based on input and current bear size - larger size makes player accelerate slower and makes speed degrade slower when the player releases the arrow key (to make the bear seem really heavy when it gets bigger)
  4. use godot physics to update the player position based on velocity
  5. Player position then updates a "chain" of 4 body positions: neck -> front body -> middle body -> back body. The neck is where the player node's position is, and then the other 3 are clamped a set distance from the point in front of it each frame. This video explains it pretty well!
    1. Legs are also procedurally animated, basically they know where they'd be if they'd just taken a step, and if they're too far away from that position they lerp towards it each frame 
  6. Bear mesh is re-made each frame by updating the points on a Polygon2D based on the body, leg, and head positions and a bunch of const offsets from those points!

I just added the project to my github if you want to take a look at the script!