MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / drawSnake

Function drawSnake

assets/js/AwesomeSnakeGame.js:17–22  ·  view source on GitHub ↗
(x,y)

Source from the content-addressed store, hash-verified

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

Callers 1

drawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected