Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualjefferytitan

Posted 16 August 2012 - 12:49 AM

It looks like you're doing simple collision within a hardcoded rectangular area. I don't see any code for checking collisions between the player and the cube. Note that because you check for collisions before moving the player/cube, they can go too far for one frame then get yanked back.

There are many things to consider when testing for collisions. For example you may need to check the area swept out by the object from one frame to another to ensure that fast moving objects don't pass straight through thin objects. There's also the question of how to resolve the situation when multiple objects collide at once, e.g. when playing pool. There's ignoring far away objects so collision checking isn't too slow. It's a huge field. Research, and have fun. :)

#1jefferytitan

Posted 16 August 2012 - 12:49 AM

It looks like you're doing simple collision within a hardcoded rectangular area. I don't see any code for checking collisions between the player and the cube. Note that because you check for collisions before moving the player/cube, they can go too far for one frame then get yanked back.

There are many things to consider when testing for collisions. For example you may need to check the area swept out by the object from one frame to another to ensure that fast moving objects don't pass straight through thin objects. There's also the question of how to resolve the situation when multiple objects collide at once, e.g. when playing pool. There's ignoring far away objects so collision checking isn't too slow. It's a huge field. Research, and have fun. :o)

PARTNERS