Today, I have nothing to worry about, so I plan to teach a beginner javascript girl's shoes to write something. So I decided to think of a plane-hitting game in order to take into account both fun and simplicity .. I wanted to use html5, but after all, I was just a beginner, And I Don't Even Know jquery. So I decided to use native javascript. Although the Code is not elegant and the efficiency is not high, it is sufficient for beginners to practice .. Three files, main. js (main function), entity. js (entity and factory), util. the basic principle of js (Tool class) is to save the location information in the object, and then update and display all objects in setInterval. The planes and bullet pictures used by the program are obtained from the screenshots. Index.html: copy the Code <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">