Skip to content

Anton-Gasse/Snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake

Test it out

https://anton-gasse.de

standard map

How to Play

  • Keyboard: use WASD or Arrow-Keys to change the direction of the Snake
  • Touch: tap the area of the screen in which direction the snake should go

Customize

You can customize the map by clicking the edit button (top-left-corner)

  • Left Click to add/delete a border
  • When the Snake goes off the map it teleports to the other side (don't forget to open it)

custom map

AI Snake

Play against AI Snake

  • Use the AI Button to activate the AI opponent
  • When the AI opponent is activatet you can switch between 2 Gamemodes (chasing the same or different apple)

How to run it

  1. Install the requirements:
pip install -r requirements.txt
  1. Run the main script in the frontend folder:
cd frontend
python3 main.py

How to run it in web browser

  1. Adapt the URL in the webmodel class to your ip and port where you will run the Flask Server:
  • It will be the same as in the app.run() method
  1. Get the build folder of the app in the frontend folder:
cd frontend
python3 -m pygbag --build --ume_block 0 --can_close 1 --title snake --app_name snake main.py
  1. Add this script tag to the this body tag
  2. Run the Flask Server in the snake folder:
cd ..
python3 ./backend/app.py

How to Dockerize the web app

  1. Run the build command:
docker build -t snake .
  1. Run the run command:
docker run --name snake -p <port>:<port> snake

About

my implementation of the classic game Snake

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published