(e)
| 44 | |
| 45 | document.addEventListener("keydown",control) |
| 46 | function control(e){ |
| 47 | if (e.keyCode==37&&dir!="right") { |
| 48 | dir="left"; |
| 49 | }else if (e.keyCode==38&&dir!="down") { |
| 50 | dir="up"; |
| 51 | }else if (e.keyCode==39&&dir!="left") { |
| 52 | dir="right"; |
| 53 | }else if (e.keyCode==40&&dir!="up") { |
| 54 | dir="down"; |
| 55 | }else if (e.keyCode==13) { |
| 56 | mode=1; |
| 57 | |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | function draw() { |
| 62 | ctx.clearRect(0,0,myCanvas.width,myCanvas.height) |
nothing calls this directly
no outgoing calls
no test coverage detected