Charpurrr / SuperMarioSolarEngine

An open source fanmade 2D Mario engine that implements elements from all the mainline 3D titles
https://docs.google.com/document/d/1hzFKpgm-1IukFWBig9A5ZsCQQEqVqJFVrNOAVmHSHJI/edit
MIT License
14 stars 7 forks source link

Player movement: Slipping implementation attempt #22

Closed Unequipped closed 4 months ago

Unequipped commented 5 months ago

Saw slipping was unimplemented and attempted adding it in. Uses code from sliding and diving actions spliced together.

Added Slip.gd file and linked the action in by attaching transitions from fall, idle, dive_slide and walk scripts. Couldn't remember exactly how slipping from steep angles worked in game so implemented it based off memory, behaviour will likely need to be tweaked or rewritten. Made it so that no action can be preformed until movement.is_steep_slope() == False to prevent players from doing things like infinitely long jumping up a steep slope. Slipping continues for a bit after movement.is_steep_slope() == False but preforming an action allows you to break out of it early similar to Mario 64 DS. Hopefully this code is useful.

This'll probably be my last contribution (for a while at least). It was a nice challenge having a shot at fixing an issue or trying to implement something. If someone had already been assigned this task or this wasn't how you intended slipping to be implemented feel free to ignore this merge request.