Commit 1a663876 authored by Davide Volta's avatar Davide Volta
Browse files

added shitbomb sound

parent ea89c007
Pipeline #6389 skipped with stage
......@@ -85,6 +85,7 @@ class Character {
this.spriteChangeTicks = 20
document.getElementById('game-container').innerHTML += `<div class="game-character" id="game-character"><img alt="game" style="width: 100%; height: 100%;" src="${Image}" /></div>`
this.shootSFX = document.getElementById('super-sfx-shoot')
this.shitSFX = document.getElementById('super-sfx-shit')
this.element = document.getElementById('game-character')
document.onkeydown = (e) => this.onKeyDown(e)
document.onkeyup = (e) => {
......@@ -118,6 +119,7 @@ class Character {
}
addVerticalProjectile() {
this.playSound(this.shitSFX)
const projectile = new VerticalProjectile(this.x + this.element.offsetWidth/2, this.y + this.element.offsetHeight, 10, 1, this.game)
this.game.ticker.add(projectile)
this.boccaAperta2 = 30
......
......@@ -6,6 +6,7 @@ import UIManager from './UIManager.js'
import Usable from './Usable.js'
import bgmusic from './assets/bgmusic.mp3'
import shootSFX from './assets/shootSFX.mp3'
import shitSFX from './assets/shitSFX.mp3'
import PageParser from './PageParser'
import Ticker from './Ticker'
import FallManager from './FallManager';
......@@ -39,7 +40,8 @@ class Game {
constructor() {
document.body.innerHTML += `<div id="game-container"><audio><source id="soundtrack-superdubstep" src="`
+ bgmusic + `" type="audio/mpeg"><source id="super-sfx-shoot" src="` + shootSFX + `" type='audio/mpeg'></audio></div>`
+ bgmusic + `" type="audio/mpeg"><source id="super-sfx-shoot" src="` + shootSFX + `" type='audio/mpeg'><source src='` + shitSFX +
`' id="super-sfx-shit" type='audio/mpeg'></audio></div>`
this.background = document.getElementById('super-background')
this.bgmusic = document.getElementById('soundtrack-superdubstep').src.replace('data:audio/mpeg;base64,', '')
......
......@@ -57,7 +57,7 @@ class Projectile {
let other = this.checkHit()
if (other !== null){
other.element.classList.add('super-game-hit')
this.game.ticker.remove(this)
this.game.ticker.remsove(this)
delete this
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment