Created
October 31, 2018 00:37
-
-
Save mwchase/f5dfbfc1a65b9c8b7c7dc3b4eb2bba0a to your computer and use it in GitHub Desktop.
Platform Collisions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Platform Collisions | |
## So, suppose we have a platformer character with one-way platforms, cancelable wall slides | |
On A Platform | |
## To jump, set the vertical velocity to JUMP_STAR | |
jump -> Going Up | |
walk off edge -> Falling | |
Airborne | |
collide with wall? -> Wallslide | |
Going Up | |
reach apex? -> Falling | |
hit ceiling? -> Falling | |
pass through one-way platform? -> Going Up | |
Falling | |
collide with platform? -> On A Platform | |
Wallslide | |
cancel -> Falling | |
jump -> Going Up | |
reach bottom? -> At Bottom Of Wall? | |
At Bottom Of Wall? | |
platform? -> On A Platform | |
no platform? -> Falling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${current_state_name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment