Skip to content

Instantly share code, notes, and snippets.

@ardcore
Created May 20, 2012 11:06
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 ardcore/2757662 to your computer and use it in GitHub Desktop.
Save ardcore/2757662 to your computer and use it in GitHub Desktop.
function resolveCollisions() {
var collision = world.m_contactList;
if (!collision) return;
var obj1 = collision.GetShape1();
var obj2 = collision.GetShape2();
if ( (obj1.m_body.m_shapeList.renderType == "player" && obj2.m_body.m_shapeList.renderType == "exit") ||
(obj2.m_body.m_shapeList.renderType == "player" && obj1.m_body.m_shapeList.renderType == "exit")) {
winGame();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment