Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- collision on all four points:
- move the player up vertically, assume they're stuck
- top left and the bottom two:
- run routine for bottom two
- run routine for left two
- top right and the bottom two:
- run routine for bottom two
- run routine for right two
- right two:
- zero horizontal velocity
- move the player horizontally so that they're as right as they can be without colliding
- left two:
- zero horizontal velocity
- move the player horizontally so that they're as left as they can be without colliding
- top left only:
- move player right a bit
- top right only:
- move player left a bit
- top two:
- zero out the vertical velocity
- bottom left, bottom right and both:
- check if we're trying to fall through a fallthroughable floor
- set a flag for being on the ground
- zero out the vertical velocity
- change the player's vertical position so that they're as far down as they can go without colliding
- if the player is pressing A and hasn't pressed A last frame, jump by setting the vertical velocity negative
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement