[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' ); |
06 |
// Create an object set (set all genie) |
10 |
var plane=createPlane(); |
11 |
// Add our plane to the genie object collection |
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 |
20 |
// Declare the integral variable |