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

Function draw

assets/js/flappybird.js:436–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

434
435//for drawing
436function draw()
437{
438 let color = ctx.createLinearGradient(0,0,cvs.width,cvs.height);
439 color.addColorStop(0,"cyan");//0%
440 color.addColorStop(0.5,"deepskyblue");//50%
441 color.addColorStop(1,"cyan");//100%
442 ctx.fillStyle=color; //getContext method!
443 ctx.fillRect(0,0,cvs.clientWidth,cvs.height);// x axis, y axis,width,height!
444 cloud.draw();
445 pipes.draw();
446 ball.draw();
447 ground.draw();
448 bird.draw();
449 getReady.draw();
450 gameOver.draw();
451 score.draw();
452
453}
454function update()
455{
456 ground.update();

Callers 1

loopFunction · 0.70

Calls 1

drawMethod · 0.45

Tested by

no test coverage detected