Live Demo Python Snake Game to Eat Food https://youtu.be/YlYW3tDxdSU
A classic Snake game built using Python and served via Flask. The snake moves around the grid, eats food, and grows longer. The game ends when the snake runs into itself or the wall.
- Smooth snake movement on a grid
- Randomly spawning food
- Score tracking based on food eaten
- Game over detection on collision
- Simple UI rendered in the browser
- Clone the repo
git clone https://github.com/ManibalaSinha/PythonFlask.git cd PythonFlask
Create and activate a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate Install dependencies
pip install -r requirements.txt Run the Flask app
python app.py Open your browser and go to http://127.0.0.1:5000 to play!
Tech Stack Python
Flask
HTML5 Canvas (for rendering game visuals)
JavaScript (client-side snake logic)
Screenshot
License MIT License – feel free to use, modify, and distribute.