Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Falling Tetris Block</title>
- <style>
- canvas {
- background: black;
- }
- </style>
- </head>
- <body>
- <canvas width="400" height="1400"></canvas>
- <script>
- const canvas = document.querySelector("canvas");
- const ctx = canvas.getContext("2d");
- let block = {
- x: 100,
- y: 0,
- width: 30,
- height: 30,
- angle: 0,
- rotationSpeed: 5,
- fallSpeed: 5
- };
- function drawBlock() {
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- // requestAnimationFrame(drawBlock);
- }
- setInterval(() => {
- // drawBlock();
- }, 41);
- drawBlock();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement