feat: docker stuff
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								386845__morganpurkis__single-gunshot-52.mp3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								386845__morganpurkis__single-gunshot-52.mp3
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								386845__morganpurkis__single-gunshot-52.wav
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								386845__morganpurkis__single-gunshot-52.wav
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								421877__sventhors__ouch_1.mp3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								421877__sventhors__ouch_1.mp3
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								421877__sventhors__ouch_1.wav
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								421877__sventhors__ouch_1.wav
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								426627__mrh4hn__zombie-grunt.mp3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								426627__mrh4hn__zombie-grunt.mp3
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								426627__mrh4hn__zombie-grunt.wav
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								426627__mrh4hn__zombie-grunt.wav
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								435651__wakerone__zombie-demon-scream.mp3
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								435651__wakerone__zombie-demon-scream.mp3
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								435651__wakerone__zombie-demon-scream.wav
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								435651__wakerone__zombie-demon-scream.wav
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										16
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -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/
 | 
				
			||||||
							
								
								
									
										5
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					services:
 | 
				
			||||||
 | 
					  game: 
 | 
				
			||||||
 | 
					    build: .
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - 8132:80
 | 
				
			||||||
							
								
								
									
										26
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								index.html
									
									
									
									
									
								
							@ -195,6 +195,18 @@
 | 
				
			|||||||
            highScore: localStorage.getItem('zombieHighScore') || 0
 | 
					            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
 | 
					        // Sprite loader
 | 
				
			||||||
        const sprites = {};
 | 
					        const sprites = {};
 | 
				
			||||||
        const spriteList = [
 | 
					        const spriteList = [
 | 
				
			||||||
@ -669,6 +681,11 @@
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                this.lastShot = Date.now();
 | 
					                this.lastShot = Date.now();
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                // Play gunshot sound
 | 
				
			||||||
 | 
					                sounds.gunshot.currentTime = 0;
 | 
				
			||||||
 | 
					                sounds.gunshot.play().catch(e => console.log('Audio play failed:', e));
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
                updateUI();
 | 
					                updateUI();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
@ -965,6 +982,10 @@
 | 
				
			|||||||
                            // Zombie died
 | 
					                            // Zombie died
 | 
				
			||||||
                            game.score += 10;
 | 
					                            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)
 | 
					                            // Random weapon drop (increased rate)
 | 
				
			||||||
                            if (Math.random() < 0.4) {
 | 
					                            if (Math.random() < 0.4) {
 | 
				
			||||||
                                const weaponKeys = Object.keys(weaponTypes);
 | 
					                                const weaponKeys = Object.keys(weaponTypes);
 | 
				
			||||||
@ -999,6 +1020,11 @@
 | 
				
			|||||||
                    if (now - game.player.lastDamage > 1000) {
 | 
					                    if (now - game.player.lastDamage > 1000) {
 | 
				
			||||||
                        game.player.health -= 10;
 | 
					                        game.player.health -= 10;
 | 
				
			||||||
                        game.player.lastDamage = now;
 | 
					                        game.player.lastDamage = now;
 | 
				
			||||||
 | 
					                        
 | 
				
			||||||
 | 
					                        // Play player ouch sound
 | 
				
			||||||
 | 
					                        sounds.playerOuch.currentTime = 0;
 | 
				
			||||||
 | 
					                        sounds.playerOuch.play().catch(e => console.log('Audio play failed:', e));
 | 
				
			||||||
 | 
					                        
 | 
				
			||||||
                        updateUI();
 | 
					                        updateUI();
 | 
				
			||||||
                        
 | 
					                        
 | 
				
			||||||
                        if (game.player.health <= 0) {
 | 
					                        if (game.player.health <= 0) {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user