June 2015
Beginner
354 pages
8h 23m
English
Carry out the following steps to handle collision:
box2dcargame.js JavaScript file in a text editor.gamewinWall reference inside the carGame global object instance as follows:carGame.gamewinWall = createGround(1200, 215, 15, 25, 0);
step function. In each step, we get the complete contact list from the world and check whether any two colliding objects are the car and the destination ground:function checkCollision() { // loop all contact list // to check if the car hits the winning wall. for (var cn = carGame.world.GetContactList(); ...Read now
Unlock full access