[Pig-front-end] High Quality Demo of WeChat flying planes, learn to write HTML5 + Canvas technology, download and use it, complete annotations ., Html5canvas

Source: Internet
Author: User

[Pig-front-end] high-quality Demo of aircraft hitting, learning to write HTML5 + Canvas technology, download and use it, complete annotations ., Html5canvas

Original article: [Pig-front-end] high-quality Demo of aircraft hitting, learning to write HTML5 + Canvas technology, download and use it, complete annotations.

Source code: http://www.zuidaima.com/share/1553027668610048.htm

 

// Obtain the drawing environment
02 var canvas=document.getElementById('canvas');
03 var context=canvas.getContext('2d');
04  
05  
06 // Create an object set (set all genie)
07 var sprites=[];
08          
09 // Create an airplane
10 var plane=createPlane();
11 // Add our plane to the genie object collection
12 sprites.push(plane);
13          
14 // Add the aircraft timing variable to record the time when the aircraft appears
15 var smallEnemyTime=0;// Record the last occurrence time of the minor aircraft
16 var middleEnemyTime=0;// Record the last occurrence time of the aircraft
17 var bigEnemyTime=0;// Record the last occurrence time of the large aircraft
18 var bulletTime=0;// Record the last occurrence time of the bullet
19  
20 // Declare the integral variable
21 var score=0;


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.