Spaces:
Running
Running
could you use the image i sent as the gorilla instead
Browse files149 unmodified lines15015115215315415515636 unmodified lines193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245149 unmodified lines// Game variablesconst canvas = document.getElementById('gameCanvas');const ctx = canvas.getContext('2d');const startScreen = document.querySelector('.start-screen');const gameOverScreen = document.querySelector('.game-over');const scoreDisplay = document.getElementById('score');const finalScoreDisplay = document.getElementById('finalScore');36 unmodified linesmoveLeft: false,moveRight: false,draw() {// Headctx.fillStyle = '#333';ctx.beginPath();ctx.arc(this.x + this.width / 2, this.y + 20, 20, 0, Math.PI * 2);ctx.fill();// Eyesctx.fillStyle = '#fff';ctx.beginPath();ctx.arc(this.x + this.width / 2 - 10, this.y + 15, 5, 0, Math.PI * 2);ctx.arc(this.x + this.width / 2 + 10, this.y + 15, 5, 0, Math.PI * 2);ctx.fill();// Mouthctx.strokeStyle = '#fff';ctx.lineWidth = 3;ctx.beginPath();ctx.arc(this.x + this.width / 2, this.y + 25, 8, 0, Math.PI);ctx.stroke();// Bodyctx.fillStyle = '#000';ctx.beginPath();ctx.roundRect(this.x, this.y + 30, this.width, this.height - 30, 10);ctx.fill();// Armsctx.fillStyle = '#000';ctx.beginPath();ctx.roundRect(this.x - 15, this.y + 40, 20, 40, 10);ctx.roundRect(this.x + this.width - 5, this.y + 40, 20, 40, 10);ctx.fill();// Legsctx.fillStyle = '#000';ctx.beginPath();ctx.roundRect(this.x, this.y + this.height - 20, 20, 30, 5);ctx.roundRect(this.x + this.width - 20, this.y + this.height - 20, 20, 30, 5);ctx.fill();// Text on backctx.fillStyle = '#e94560';ctx.font = '8px "Press Start 2P"';ctx.textAlign = 'center';ctx.fillText('En oberoende', this.x + this.width / 2, this.y + 50);ctx.fillText('möjliggörare', this.x + this.width / 2, this.y + 65);},update() {if (this.moveLeft && this.x > 0) {this.x -= this.speed;149 unmodified lines15015115215315415515615715836 unmodified lines195196197198199200201202203204205149 unmodified lines// Game variablesconst canvas = document.getElementById('gameCanvas');const ctx = canvas.getContext('2d');const gorillaImg = new Image();gorillaImg.src = 'https://huggingface.co/spaces/BabloOG/gorilla-traffic-dodger/resolve/main/images/linnea-removebg-preview.png';const startScreen = document.querySelector('.start-screen');const gameOverScreen = document.querySelector('.game-over');const scoreDisplay = document.getElementById('score');const finalScoreDisplay = document.getElementById('finalScore');36 unmodified linesmoveLeft: false,moveRight: false,draw() {// Create gorilla imageconst gorillaImg = new Image();gorillaImg.src = 'https://huggingface.co/spaces/BabloOG/gorilla-traffic-dodger/resolve/main/images/linnea-removebg-preview.png';ctx.drawImage(gorillaImg, this.x, this.y, this.width, this.height);},update() {if (this.moveLeft && this.x > 0) {this.x -= this.speed;
index.html+8-48