HTML5APP practice (2): racing games and html5app practice

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.