<br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode45'));"><u>코드 복사</u></span></div>코드는 다음과 같습니다.</div> <div class="msgborder" id="phpcode45"> <br><!DOCTYPE html> <html> <br><head> <br><body onkeydown="changeDirect()"><canvas id="tankMap" width="500px" height=" 300px" style="border:1px solid #d3d3d3;">브라우저가 캔버스 태그</canvas>를 지원하지 않습니다. <br><script type="text/javascript"> =document .getElementById('tankMap'); <br>var ctx=canvas1.getContext('2d'); <br>var myX=30; <br>var myY=30; 🎜> ctx.shadowBlur=30,ctx.shadowColor="#008C46"; <br>ctx.fillStyle='#008C46'; <br>ctx.fillRect(myX,myY,5,30)<br>ctx. fillRect( myX 17,myY,5,30); <br>ctx.fillRect(myX 6,myY 5,10,20) <br>ctx.beginPath() <br>ctx.fillStyle='#004020' ; <br>ctx.arc(myX 11,myY 15,5,0,Math.PI*1.5) <br>ctx.closePath() <br>ctx.strokStyle= "# 008C46"; <br>ctx.moveTo(myX 11,myY 15); <br>ctx.lineTo(myX 11,myY-5) <br>ctx.strok(); drawBall( ); <br>functionchangeDirect(){ <br>var code=event.keyCode <br>switch(code){ <br>case 87: <br>myY-- <br> >case 68: <br>break; <br>case 83: <br>myY ; <br>case 65: <br>myX--; >} <br>ctx.clearRect(0,0,500,300) <br>//Redraw<br>drawBall() <br>} <br></script> < ;/html> <br><br> </div>