Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6.  
  7. <title>jatt the maquebla</title>
  8. <meta name="description" content="The HTML5 Herald">
  9. <meta name="author" content="SitePoint">
  10.  
  11.  
  12.  
  13. </head>
  14.  
  15. <body>
  16. <canvas id="pong" width="600" height="400"></canvas>
  17. <script src="App.js"></script>
  18.  
  19. </body>
  20. </html>
  21.  
  22. // select the canvas that we have made in our html file
  23. const cvs = document.getElementById("pong");
  24. const ctx = cvs.getContext("2d");
  25.  
  26. // draw our rectangle function
  27.  
  28. function drawRect(x, y, w, h, color) {
  29. ctx.fillStyle = color;
  30. ctx.fillRect(x,y,w,h);
  31. }
  32.  
  33. drawRect(0, 0, cvs.wdith, cvs.height, "BLACK");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement