Kommentar: Ich glaube, Sie sind sich der HTML5 bereits bewusst. Mit HTML5 können Sie viele Dinge tun. Lassen Sie uns mit Ihnen teilen, wie Sie einen Tank mit HTML5 zeichnen. Der spezifische Code ist wie folgt. Jeder, der interessiert ist, kann sich darauf beziehen.
var canvas = document.getElementById ('mycanvas');
var ctx = canvas.getContext ('2d');
ctx.fillStyle = "#99ff66";
Ctx.FillRect (10,10,15,80);
//CTX.FillRect(10,80,15,80);
var canvas = document.getElementById ('mycanvas');
var ctx = canvas.getContext ('2d');
ctx.fillStyle = "#99ff66";
Ctx.FillRect (60,10,15,80);
var canvas = document.getElementById ('mycanvas');
var ctx = canvas.getContext ('2d');
ctx.fillStyle = "#0033cc";
Ctx.FillRect (26,27,33,50);
ctx.fillStyle = "rot";
ctx.beginPath ();
ctx.arc (43,52,17,0, math.pi*2, true);
ctx.closepath ();
ctx.fill ();
ctx.stroketyle = "#cccc00";
ctx.linewidth = 2;
ctx.moveto (43,52);
ctx.lineto (43,10);
ctx.stroke ();