Inspired by the recently released Spelunky 2, I’ve been making Spelunky clone from scratch using Monogame for gamedev coding practice.
I’ve successfully coded the basic platforming mechanics: terrain collision solving, gravity, running and jumping, even having the camera pan up or down after pressing those buttons for a half-second.
The next thing I am trying to implement is edge-hanging. Getting the basic case of hanging after falling onto an edge in the right way was easy enough. I basically just checked for the right conditions and added a boolean in my player class for whether the player is hanging, which prevents left/right motion and keeps the player from falling when it’s true.
My question is: how can I implement the edge-rolling mechanism, where you can roll over edges into an edge-hang by pressing down as you walk off? I don’t understand what extra information I need to store or how to smoothly transition the player from being halfway on the edge to hanging off of the edge one block lower.
Right now the player just kind of falls away from the edge after walking off, as you would expect with the basic mechanics so far.
Any advice is appreciated! Thanks for your time.
0 Asked on March 5, 2021 by jinxy
1 Asked on March 2, 2021 by pocketonion
0 Asked on February 27, 2021 by pale_rider
1 Asked on February 22, 2021 by yookakim
2 Asked on February 22, 2021 by christian-ivicevic
0 Asked on February 19, 2021 by antonio-agustin
1 Asked on February 12, 2021 by muhammad-faizan-khan
1 Asked on February 12, 2021 by json-brody
1 Asked on February 4, 2021 by user3150201
1 Asked on February 3, 2021 by kit-k
0 Asked on January 29, 2021
1 Asked on January 24, 2021 by herewego
Get help from others!