Skip to content

Instantly share code, notes, and snippets.

@mwchase
Last active July 11, 2018 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwchase/7cc01a5103b0538ff76685007a21c3ea to your computer and use it in GitHub Desktop.
Save mwchase/7cc01a5103b0538ff76685007a21c3ea to your computer and use it in GitHub Desktop.
## So, suppose we have a platformer character with one-way platforms, cancelable wall slides
## So, suppose we have a platformer character with one-way platforms, cancelable wall slides
Platform Collisions
On A Platform
## To jump, set the vertical velocity to JUMP_START
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
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