diff --git a/386845__morganpurkis__single-gunshot-52.mp3 b/386845__morganpurkis__single-gunshot-52.mp3 new file mode 100644 index 0000000..e2df7f4 Binary files /dev/null and b/386845__morganpurkis__single-gunshot-52.mp3 differ diff --git a/386845__morganpurkis__single-gunshot-52.wav b/386845__morganpurkis__single-gunshot-52.wav new file mode 100644 index 0000000..2d41b1d Binary files /dev/null and b/386845__morganpurkis__single-gunshot-52.wav differ diff --git a/421877__sventhors__ouch_1.mp3 b/421877__sventhors__ouch_1.mp3 new file mode 100644 index 0000000..7973d88 Binary files /dev/null and b/421877__sventhors__ouch_1.mp3 differ diff --git a/421877__sventhors__ouch_1.wav b/421877__sventhors__ouch_1.wav new file mode 100644 index 0000000..03a7347 Binary files /dev/null and b/421877__sventhors__ouch_1.wav differ diff --git a/426627__mrh4hn__zombie-grunt.mp3 b/426627__mrh4hn__zombie-grunt.mp3 new file mode 100644 index 0000000..b89c7bb Binary files /dev/null and b/426627__mrh4hn__zombie-grunt.mp3 differ diff --git a/426627__mrh4hn__zombie-grunt.wav b/426627__mrh4hn__zombie-grunt.wav new file mode 100644 index 0000000..60cfcc0 Binary files /dev/null and b/426627__mrh4hn__zombie-grunt.wav differ diff --git a/435651__wakerone__zombie-demon-scream.mp3 b/435651__wakerone__zombie-demon-scream.mp3 new file mode 100644 index 0000000..e7e1885 Binary files /dev/null and b/435651__wakerone__zombie-demon-scream.mp3 differ diff --git a/435651__wakerone__zombie-demon-scream.wav b/435651__wakerone__zombie-demon-scream.wav new file mode 100644 index 0000000..2d99032 Binary files /dev/null and b/435651__wakerone__zombie-demon-scream.wav differ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bade2ed --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM caddy:2-alpine + +# Copy all static files to Caddy's default serve directory +COPY . /usr/share/caddy/ + +# Create Caddyfile for HTTP only serving +RUN echo "# Caddyfile" > /etc/caddy/Caddyfile && \ + echo ":80 {" >> /etc/caddy/Caddyfile && \ + echo " root * /usr/share/caddy" >> /etc/caddy/Caddyfile && \ + echo " file_server" >> /etc/caddy/Caddyfile && \ + echo "}" >> /etc/caddy/Caddyfile + +# Expose port 80 +EXPOSE 80 + +# Caddy will automatically use the Caddyfile in /etc/caddy/ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..79b8686 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + game: + build: . + ports: + - 8132:80 diff --git a/index.html b/index.html index 6d1f5db..cf19f62 100644 --- a/index.html +++ b/index.html @@ -195,6 +195,18 @@ highScore: localStorage.getItem('zombieHighScore') || 0 }; + // Audio loader + const sounds = { + gunshot: new Audio('386845__morganpurkis__single-gunshot-52.wav'), + zombieGrunt: new Audio('426627__mrh4hn__zombie-grunt.wav'), + playerOuch: new Audio('421877__sventhors__ouch_1.wav') + }; + + // Set volume levels + sounds.gunshot.volume = 0.3; + sounds.zombieGrunt.volume = 0.5; + sounds.playerOuch.volume = 0.7; + // Sprite loader const sprites = {}; const spriteList = [ @@ -669,6 +681,11 @@ } this.lastShot = Date.now(); + + // Play gunshot sound + sounds.gunshot.currentTime = 0; + sounds.gunshot.play().catch(e => console.log('Audio play failed:', e)); + updateUI(); } @@ -965,6 +982,10 @@ // Zombie died game.score += 10; + // Play zombie grunt sound + sounds.zombieGrunt.currentTime = 0; + sounds.zombieGrunt.play().catch(e => console.log('Audio play failed:', e)); + // Random weapon drop (increased rate) if (Math.random() < 0.4) { const weaponKeys = Object.keys(weaponTypes); @@ -999,6 +1020,11 @@ if (now - game.player.lastDamage > 1000) { game.player.health -= 10; game.player.lastDamage = now; + + // Play player ouch sound + sounds.playerOuch.currentTime = 0; + sounds.playerOuch.play().catch(e => console.log('Audio play failed:', e)); + updateUI(); if (game.player.health <= 0) {