Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@



<script src="src/main.js"></script>
<script src="src/invader.js"></script>
<script src="src/prof.js"></script>
<script src="src/light-ball.js"></script>
<script src="./src/main.js"></script>
<script src="./src/invader.js"></script>
<script src="./src/prof.js"></script>
<script src="./src/light-ball.js"></script>
</body>

</html>
8 changes: 4 additions & 4 deletions src/invader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(){
Expand Down
2 changes: 1 addition & 1 deletion src/light-ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}
Expand All @@ -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"
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion src/prof.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down