HTML5APP practice (2): racing games and html5app practice
First Show the final running effect:
Http://gamebuilder.duapp.com/apprun.html? Appid = genius-441422599398441
Online Editing page:
Http://gamebuilder.duapp.com/gamebuilder.php? Appid = genius-441422599398441
1. Create a project and delete the basketball and lawn. Select vertical tile and place a just-examined road in the middle of the road to divide the road into two.
2. Set the virtual height of the game scenario to 5000, And the gravity in the X and Y directions to 0.
3. Place a counter to calculate the display score
4. place two rigid bodies and set the background image to represent the two cars.
4. Set the automobile density to 1, and the friction coefficient and elasticity coefficient are both 0.5.
5. place some paper towels and feces randomly on the runway to indicate obstacles.
6. To avoid collision, set the obstacle rigid body as a sensor.
Next, write the code,
1) Whether to update the score when a car is collided:
2) Onopen event processing in scenarios
References:
Https://github.com/drawapp8/gamebuilder/wiki/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3