Streak Club is a place for hosting and participating in creative streaks.
so. what did i learn from other 2D platformer games that makes walking such a complicated thing to implement? well, the two gifs i recorded today illustrates part of the problem.
the cyan line represents the normal of the surface the player is currently considered standing on. when the player is in the air, the normal becomes straight up. since i'm just walking on this slope, we shouldn't see the cyan line point straight up, but it does as i walk up and down. as i stop walking up the slope, my vertical velocity pops me into the air, and as i walk down, i hop off of the ground because i move directly left, and not down the slope.
i've started working on the fix, as shown in the second gif. the red line now shows the actual direction i'm walking in. as i walk up the slope now, i pop up over and over again, but the descent is nice and smooth.
so the next goal is to basically "magnet" my feet to the floor while i'm just walking across the ground. this is easier said than done, but i did a little more work after this gif and am getting close. access to the normal of the floor will also let me cleverly solve the issue of walking (or not being able to walk) up slopes...
joined 1,787 days ago
Post a comment