commit 3abb79af8334bdf4ff21708d6605e8f9e73e243f Author: Bill Rossi Date: Sun Jun 1 15:30:12 2025 -0400 Initial commit diff --git a/index.html b/index.html new file mode 100644 index 0000000..1b5908c --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + Zelder + + + + + You need a better browser to play this game. + + + diff --git a/src/game.js b/src/game.js new file mode 100644 index 0000000..37715b8 --- /dev/null +++ b/src/game.js @@ -0,0 +1,16 @@ +export default class Game { + constructor(canvas) { + this.canvas = canvas + this.ctx = canvas.getContext("2d") + } + + draw() { + const { canvas, ctx } = this + ctx.clearRect(0, 0, canvas.width, canvas.height) + ctx.beginPath() + ctx.fillColor = "#FF0000" + ctx.rect(200, 100, 80, 50) + ctx.fill() + ctx.closePath() + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..a800229 --- /dev/null +++ b/src/index.js @@ -0,0 +1,8 @@ +import Game from "./game.js" + +document.addEventListener("DOMContentLoaded", e => { + console.log("Hello, world!") + const canvas = document.getElementById("game-canvas") + const game = new Game(canvas) + game.draw() +})