利用HTML5画出一个坦克的形状具体实现代码

2022-10-20,,,,

复制代码代码如下:
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="red";
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();

《利用HTML5画出一个坦克的形状具体实现代码.doc》

下载本文的Word格式文档,以方便收藏与打印。