利用canvas完成坦克大战,主要实现方法:类,定时器
html代码
<!doctype html> <html> <head> <title>canvas test</title> <meta charset="utf-8" /> <style> canvas{background-color:black} </style> </head> <body> <canvas id="map" width="800" height="400"></canvas> <p id="num"></p> <p id="tank0"></p> <p id="tank1"></p> <p id="tank2"></p> </body> <script src="tank02.js"></script> </html>