Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>jatt the maquebla</title>
- <meta name="description" content="The HTML5 Herald">
- <meta name="author" content="SitePoint">
- </head>
- <body>
- <canvas id="pong" width="600" height="400"></canvas>
- <script src="App.js"></script>
- </body>
- </html>
- // select the canvas that we have made in our html file
- const cvs = document.getElementById("pong");
- const ctx = cvs.getContext("2d");
- // draw our rectangle function
- function drawRect(x, y, w, h, color) {
- ctx.fillStyle = color;
- ctx.fillRect(x,y,w,h);
- }
- drawRect(0, 0, cvs.wdith, cvs.height, "BLACK");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement