diff --git a/index.html b/index.html index 4784f2e..3b6216d 100644 --- a/index.html +++ b/index.html @@ -158,10 +158,10 @@ - - - - + + + + \ No newline at end of file diff --git a/src/invader.js b/src/invader.js index 4cac154..a6fd8f7 100644 --- a/src/invader.js +++ b/src/invader.js @@ -2,7 +2,7 @@ class Invader { constructor(randomX){ this.node = document.createElement("img") - this.node.src = "../assets/img/ground-alien.png" + this.node.src = "./assets/img/ground-alien.png" this.node.style.zIndex = 2 this.node.style.position = 'absolute' gameBoxNode.append(this.node) //to add the node to game box on pipe creation @@ -27,9 +27,9 @@ class Invader { this.life = 5 - this.dieFx = new Audio('../assets/audio/fx/alien-exploded.mp3') - this.spawnFx = new Audio('../assets/audio/fx/alien-spawn-sound.mp3') - this.occupyFx = new Audio('../assets/audio/fx/alien-spawn-sound.mp3') + this.dieFx = new Audio('./assets/audio/fx/alien-exploded.mp3') + this.spawnFx = new Audio('./assets/audio/fx/alien-spawn-sound.mp3') + this.occupyFx = new Audio('./assets/audio/fx/alien-spawn-sound.mp3') } automaticMovement(){ diff --git a/src/light-ball.js b/src/light-ball.js index 4ecc7f0..f9a9033 100644 --- a/src/light-ball.js +++ b/src/light-ball.js @@ -2,7 +2,7 @@ class LightBall { constructor(profX){ this.node = document.createElement("img") - this.node.src = "../assets/img/light-ball.png" + this.node.src = "./assets/img/light-ball.png" this.node.style.zIndex = 7 this.node.style.position = 'absolute' gameBoxNode.append(this.node) //to add the node to game box on pipe creation diff --git a/src/main.js b/src/main.js index 089aa07..a5229f1 100644 --- a/src/main.js +++ b/src/main.js @@ -104,15 +104,15 @@ let isSfxOn = true // music paths -let startScreenMusic = new Audio('../assets/audio/music/start-menu-music.mp3') -let gameBoxMusic = new Audio('../assets/audio/music/gameplay-music.mp3') -let resultScreenMusic = new Audio('../assets/audio/music/end-game-music.mp3') +let startScreenMusic = new Audio('./assets/audio/music/start-menu-music.mp3') +let gameBoxMusic = new Audio('./assets/audio/music/gameplay-music.mp3') +let resultScreenMusic = new Audio('./assets/audio/music/end-game-music.mp3') // fx paths -let countDownFX = new Audio('../assets/audio/fx/game-countdown.mp3') -let lightBallSound = new Audio('../assets/audio/fx/light-ball-sound.mp3') -let gameOverMusic = new Audio('../assets/audio/fx/game-over-music.mp3') -let gameOverVoice = new Audio('../assets/audio/fx/game-over-voice.mp3') +let countDownFX = new Audio('./assets/audio/fx/game-countdown.mp3') +let lightBallSound = new Audio('./assets/audio/fx/light-ball-sound.mp3') +let gameOverMusic = new Audio('./assets/audio/fx/game-over-music.mp3') +let gameOverVoice = new Audio('./assets/audio/fx/game-over-voice.mp3') // set all music to loop// startScreenMusic.loop = true @@ -421,7 +421,7 @@ document.addEventListener('keydown', e => { profObj.x += profObj.moveSpeed profObj.node.style.left = `${profObj.x}px` } else if ((key === 'w' || key === 'arrowup')) { - profObj.node.src = "../assets/img/prof-hands-up.png" + profObj.node.src = "./assets/img/prof-hands-up.png" createLightBall() } } @@ -432,7 +432,7 @@ document.addEventListener('keyup', e => { const key = e.key.toLowerCase() if ((key === 'w' || key === 'arrowup')) { - profObj.node.src = "../assets/img/prof-stable.png" + profObj.node.src = "./assets/img/prof-stable.png" } } ) diff --git a/src/prof.js b/src/prof.js index 3605645..36c00dc 100644 --- a/src/prof.js +++ b/src/prof.js @@ -2,7 +2,7 @@ class Prof { constructor(){ this.node = document.createElement('img') this.node.id = 'prof' - this.node.src = "../assets/img/prof-stable.png" + this.node.src = "./assets/img/prof-stable.png" gameBoxNode.append(this.node) this.node.style.position = 'absolute' this.node.style.zIndex = 8