Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Collision points:
- A___B
- | |
- | E |
- F|C_D|G
- Procedure:
- If the player's feet are above the top of the screen, abort.
- Read the block types under A, B, C, D and E, and record whether block types at A, B, C and D are solid.
- If those block types have behaviors that need to trigger upon being touched, run those behaviors.
- If the player is not touching a ladder, reset the "on ladder" flag.
- If the "player standing on moving platform" flag is on, force C and D to be recorded as solid.
- Use the solidity of A, B, C and D to look up a reaction from this table:
- ..
- ..
- Record this position as the last known good one.
- AB AB
- C. .C
- Do nothing.
- A. .B AB
- .D C. CD
- Reset to the last known good position.
- A.
- CD
- Run behavior for ..CD and then A.C.
- .B
- CD
- Run behavior for ..CD and then .B.D
- .B
- ..
- Check if it's bricks or an item box and break it if so.
- Reset horizontal speed.
- If player vertical speed is negative and G is nonsolid, reset vertical position.
- If F is nonsolid, snap the player left enough to no longer collide with the block.
- A.
- ..
- Check if it's bricks or an item box and break it if so.
- Reset horizontal speed.
- If player vertical speed is negative and F is nonsolid, reset vertical position.
- If G is nonsolid, snap the player right enough to no longer collide with the block.
- .B
- .D
- Reset horizontal speed.
- Snap the player left enough to no longer collide with the block.
- A.
- C.
- Reset horizontal speed.
- Snap the player right enough to no longer collide with the block.
- AB
- ..
- Check if the blocks above are bricks or an item box and break them if so.
- Reset vertical speed.
- .. .. ..
- CD C. .D
- Record this position as the last known good one.
- Reset the "on ladder" flag.
- If the blocks the player are standing on are spikes, hurt the player.
- If the player is standing on fall-through platforms and has been holding down for 8 frames, fall through the floor.
- If the player is standing on a ladder and has been holding down for 4 frames, turn on "on ladder" flag.
- Allow the player to start or stop running.
- If the player is not riding on a moving platform, snap them up far enough that they're not touching the ground. (only if the foot is in the top half of the block, not the bottom half)
- If the player presses A, start a jump by setting the player's velocity negative.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement