(x,y)
| 15 | ctx.font="45px"; |
| 16 | ctx.fillText(score,200,200); |
| 17 | function drawSnake(x,y){ |
| 18 | ctx.fillStyle='#fff'; |
| 19 | ctx.fillRect(x*snakeWidth,y*snakeHeight,snakeWidth,snakeHeight); |
| 20 | ctx.fillStyle='#000'; |
| 21 | ctx.strokeRect(x*snakeWidth,y*snakeHeight,snakeWidth,snakeHeight); |
| 22 | } |
| 23 | ///food |
| 24 | var food={ |
| 25 | x:Math.round(Math.random()*(myCanvas.width/snakeWidth-1)), |