mitch3a / SuperMarioWar

Hoping to rewrite existing SMW code in java with the hopes to fix crashes + expand play
7 stars 2 forks source link

Wrapping Collision Issue #2

Closed mitch3a closed 10 years ago

mitch3a commented 10 years ago

If there is a wall on the edge of the right side of the screen, and nothing on the left side of the screen, there is a collision bug when running and jumping into the wall (as in trying to wrap from the left side of the screen into a wall on the right side of the screen)

mitch3a commented 10 years ago

The issue was that if a players current x was 0 but wanted to move to 639.5, the comparison xNow < xNext is used to determine if a player is moving right. This isn't caught because with the wrap, the now ends up less than the next even though he's moving left. Put in a crappy fix (that works) with a todo to revisit it.