diff --git a/src/scene/BackgroundScene.js b/src/scene/BackgroundScene.js index 07db40a..3bb8b26 100644 --- a/src/scene/BackgroundScene.js +++ b/src/scene/BackgroundScene.js @@ -9,9 +9,9 @@ export class BackgroundScene { this.jupiterRotationAngle = 0 /* ------------------------------ ASSETS PRELOAD ----------------------------- */ this.jupiterPng = new Image(); - this.jupiterPng.src = "assets/img/jupiter.png"; + this.jupiterPng.src = "/assets/img/jupiter.png"; this.bgMusic = new Audio(); - this.bgMusic.src = "assets/audio/bg.mp3"; + this.bgMusic.src = "/assets/audio/bg.mp3"; this.bgMusic.loop = true /* ------------------------------ ASSETS PRELOAD ----------------------------- */ } diff --git a/src/scene/BallScene.js b/src/scene/BallScene.js index fe6a656..bae2f20 100644 --- a/src/scene/BallScene.js +++ b/src/scene/BallScene.js @@ -11,7 +11,7 @@ export class BallScene { this.speed = 2.5 /* ------------------------------ BALL PRELOAD ------------------------------ */ this.ball = new Image() - this.ball.src = "assets/img/ball.png" + this.ball.src = "/assets/img/ball.png" /* ------------------------------ BALL PRELOAD ------------------------------ */ } draw() { diff --git a/src/scene/CharacterScene.js b/src/scene/CharacterScene.js index 97a4b9b..9c2a763 100644 --- a/src/scene/CharacterScene.js +++ b/src/scene/CharacterScene.js @@ -10,12 +10,12 @@ const sfxHit1 = new Audio(); const sfxHit2 = new Audio(); const sfxCaught = new Audio(); sfxCaught.volume = 0.5; // THE SFX IS SO LOUD NGL -sfxCaught.src = "assets/audio/caught.wav"; +sfxCaught.src = "/assets/audio/caught.wav"; sfxDied.volume = 0.5; // THE SFX IS SO LOUD NGL -sfxDied.src = "assets/audio/destroy.wav"; -sfxDodge.src = "assets/audio/dodge.wav"; -sfxHit1.src = "assets/audio/hit-0.wav"; -sfxHit2.src = "assets/audio/hit-1.wav"; +sfxDied.src = "/assets/audio/destroy.wav"; +sfxDodge.src = "/assets/audio/dodge.wav"; +sfxHit1.src = "/assets/audio/hit-0.wav"; +sfxHit2.src = "/assets/audio/hit-1.wav"; const sfxHit = [sfxHit1, sfxHit2]; /* ------------------------------- AUDIO LOAD ------------------------------- */ @@ -44,9 +44,9 @@ export class PlayerScene { this.playerSpriteDefault = new Image(); this.playerSpriteCaught = new Image(); this.playerSpriteHit = new Image(); - this.playerSpriteDefault.src = "assets/img/player.png"; - this.playerSpriteCaught.src = "assets/img/bot0-caught.png"; - this.playerSpriteHit.src = "assets/img/bot0-hit.png"; + this.playerSpriteDefault.src = "/assets/img/player.png"; + this.playerSpriteCaught.src = "/assets/img/bot0-caught.png"; + this.playerSpriteHit.src = "/assets/img/bot0-hit.png"; /* ------------------------------ ASSETS PRELOAD ----------------------------- */ this.playerSprite = this.playerSpriteDefault; /* ------------------------------- CONTROLLER ------------------------------- */ @@ -184,9 +184,9 @@ export class BotScene { this.botSpriteDefault = new Image(); this.botSpriteCaught = new Image(); this.botSpriteHit = new Image(); - this.botSpriteDefault.src = `assets/img/bot${spriteNumber}.png`; - this.botSpriteCaught.src = `assets/img/bot${spriteNumber}-caught.png`; - this.botSpriteHit.src = `assets/img/bot${spriteNumber}-hit.png`; + this.botSpriteDefault.src = `/assets/img/bot${spriteNumber}.png`; + this.botSpriteCaught.src = `/assets/img/bot${spriteNumber}-caught.png`; + this.botSpriteHit.src = `/assets/img/bot${spriteNumber}-hit.png`; /* ------------------------------ IMAGE PRELOAD ----------------------------- */ this.botSprite = this.botSpriteDefault; } diff --git a/src/styles/style.css b/src/styles/style.css index 8e47448..c8d53f5 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -18,7 +18,7 @@ body { .menu { z-index: 1; - background-image: url(https://medarwin.github.io/jupiter-hitter/assets/img/bg.png); + background-image: url(/assets/img/bg.png); background-color: black; background-size: cover; display: flex;