Skip to content

Commit

Permalink
fix(assets): attempt to fix assets link #2
Browse files Browse the repository at this point in the history
  • Loading branch information
LmaoDarwin committed Dec 6, 2023
1 parent 18a93c5 commit 4a39aee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/scene/BackgroundScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----------------------------- */
}
Expand Down
2 changes: 1 addition & 1 deletion src/scene/BallScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
22 changes: 11 additions & 11 deletions src/scene/CharacterScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ------------------------------- */

Expand Down Expand Up @@ -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 ------------------------------- */
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body {

.menu {
z-index: 1;
background-image: url(./assets/img/bg.png);
background-image: url(/assets/img/bg.png);
background-color: black;
background-size: cover;
display: flex;
Expand Down

0 comments on commit 4a39aee

Please sign in to comment.