From 5f066cd71edb0d456cff5d4e959ad64e8c73a91a Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Wed, 13 Aug 2025 12:40:18 -0700 Subject: [PATCH] fix stuff --- static/script.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/static/script.js b/static/script.js index 51a23bc..6a986a1 100644 --- a/static/script.js +++ b/static/script.js @@ -29,8 +29,6 @@ window.addEventListener("DOMContentLoaded", function() { this.isAlive = true; } - - update() { this.vx = 0; if (this.keys.h) { @@ -98,6 +96,10 @@ window.addEventListener("DOMContentLoaded", function() { const legLength = crouch ? 20 : 25; if (crouch) y += 15; // shift down a touch so crouch looks grounded + // Set drawing styles + ctx.strokeStyle = "black"; + ctx.fillStyle = "black"; + ctx.lineWidth = 2; // head ctx.beginPath(); @@ -284,9 +286,6 @@ window.addEventListener("DOMContentLoaded", function() { this.time = 0; this.players = { - "player": new StickFigure(10, 1, "player", this.canvas), - "player1": new StickFigure(100, 1, "player1", this.canvas) - }; this.pageData = this._getPageData(); @@ -309,7 +308,7 @@ window.addEventListener("DOMContentLoaded", function() { start() { if (this._started) return; - this.started = true; + this._started = true; // FIXED: was "this.started = true" this._stopped = false; document.addEventListener("keydown", this._onKeyDown); @@ -398,7 +397,6 @@ window.addEventListener("DOMContentLoaded", function() { playerArray.forEach(player => { player.draw(this.ctx, this.time); // Call the draw method for each player - }) requestAnimationFrame(this.loop)