repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
automated repo
stars
latest
clone command
git clone gitlawb://did:key:z6Mku9hh...hqrk/hyper-363500git clone gitlawb://did:key:z6Mku9hh.../hyper-3635009d7082dfauto generated commit4h ago| #3 | <html> |
| #4 | <body style="background:black;color:white;text-align:center"> |
| #5 |
| #6 | <h1>HTML5 Space Game</h1> |
| #7 |
| #8 | <canvas id="game" width="500" height="400"></canvas> |
| #9 |
| #10 | <script> |
| #11 | const c = document.getElementById("game"); |
| #12 | const ctx = c.getContext("2d"); |
| #13 |
| #14 | let x = 0; |
| #15 |
| #16 | function loop() { |
| #17 |
| #18 | ctx.clearRect(0,0,500,400); |
| #19 |
| #20 | ctx.fillStyle = "red"; |
| #21 | ctx.fillRect(x,180,50,50); |
| #22 |
| #23 | x += 3; |
| #24 |
| #25 | if(x > 500) x = -50; |
| #26 |
| #27 | requestAnimationFrame(loop); |
| #28 | } |
| #29 |
| #30 | loop(); |
| #31 | </script> |
| #32 |
| #33 | </body> |
| #34 | </html> |
| #35 |