Sign inSign up

alemar16/snake-game

By alemar16

•Updated about 2 years ago

Se trata de una aplicación web que simula el juego de la serpiente, usando html, css y javascript

Image
Languages & frameworks
0

10K+

alemar16/snake-game repository overview

⁠Snake Game

This repository contains a simple snake game built with HTML, CSS, and JavaScript. The Docker image allows you to easily deploy and run the game in a containerized environment.

⁠How to Use

  1. Pull the image from Docker Hub:

    docker pull alemar16/snake-game:latest
    
  2. Run the container:

    docker run -d -p 8080:80 alemar16/snake-game:latest
    
  3. Open your browser and navigate to http://localhost:8080⁠ to play the game.

⁠Repository Structure

  snake-game
├─ css
│  ├─ game-area.css
│  ├─ info-area.css
│  ├─ layout.css
│  ├─ modals
│  │  ├─ game-over-modal.css
│  │  ├─ modal-game.css
│  │  └─ welcome-modal.css
│  ├─ quote.css
│  └─ reset.css
├─ images
│  ├─ backgrounds
│  │  ├─ background-body.jpg
│  │  └─ background-image-game.jpg
│  ├─ flowers
│  │  ├─ flower1.svg
│  │  ├─ flower2.svg
│  │  └─ flower3.svg
│  ├─ fruits
│  │  ├─ apple.svg
│  │  ├─ banana-fruit.png
│  │  ├─ grapes-fruit.png
│  │  ├─ kiwi-fruit.png
│  │  ├─ mango-fruit.png
│  │  ├─ orange-fruit.png
│  │  ├─ papaya-fruit.png
│  │  ├─ pear-fruit.png
│  │  ├─ pineapple-fruit.png
│  │  ├─ strawberry-fruit.png
│  │  └─ watermelon-fruit.png
│  ├─ icons
│  │  ├─ favicon.png
│  │  ├─ grid-minus.svg
│  │  ├─ grid-plus.svg
│  │  ├─ half-moon.svg
│  │  ├─ music-note-plus-solid.svg
│  │  ├─ music-note-solid.svg
│  │  ├─ skip-next.svg
│  │  ├─ skip-prev.svg
│  │  ├─ sound-high.svg
│  │  ├─ sound-off.svg
│  │  └─ sun-light.svg
│  ├─ insects
│  │  ├─ abeja.png
│  │  ├─ caracol.png
│  │  ├─ gusano.png
│  │  ├─ hormiga.png
│  │  ├─ libelula.png
│  │  ├─ mariposa.png
│  │  ├─ mariquita.png
│  │  └─ mosquito.png
│  ├─ logo
│  │  ├─ arrow-keys.png
│  │  ├─ logo-snake.png
│  │  ├─ snake-image-logo.png
│  │  ├─ snake-title.png
│  │  ├─ space-key.png
│  │  └─ wasd.png
│  └─ snake
│     ├─ snake-down.svg
│     ├─ snake-left.svg
│     ├─ snake-right.svg
│     └─ snake-up.svg
├─ index.html
└─ scripts
   ├─ food.js
   ├─ game.js
   ├─ grid.js
   ├─ main.js
   ├─ scoreboard.js
   ├─ snake.js
   ├─ turbo.js
   ├─ util.js
   └─ welcome.js

⁠Dockerfile

The Dockerfile is used to create the Docker image. It sets up a simple web server to serve the game files.

 # Use a basic Nginx image to serve the static files
FROM nginx:alpine

# Copy the game files to the Nginx HTML directory
COPY . /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# Start Nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]

⁠License

This project is licensed under the MIT License.

Tag summary

Content type

Image

Digest

sha256:d1854bab2…

Size

28.1 MB

Last updated

about 2 years ago

docker pull alemar16/snake-game