Two classic games in python: Pong and Sneak.
To play, first clone this repository using these commands:
git clone https://github.com/glensk/Pong
cd Pong
To play snake, run pip3 install pygame
once installed, run python3 snake
.
Pong in python is for singleplayer or muyltiplayer.
- Upon start, type singleplayer or multiplayer.
- Uses keys "w" and "s" for left player.
- Use keys "up-arrow" and "down-arrow" for right player.
- to play, follow the steps below (install tkinter && Run Pong).
Now, we need to install the tkinter
library for your specific version of
python. To find your version of python, type:
python3 --version
For example, my Python version is 3.11, so I would install as
# 🚨 Make sure to specify the correct Python version.
# 👇️ === UBUNTU / DEBIAN ===
sudo apt-get install python3.11-tk
# 👇️ === MacOS ===
brew install python-tk@3.11
# 👇️ === Fedora ===
sudo dnf install python3-tkinter
# 👇️ === CentOS ===
sudo yum install python3-tkinter
# 👇️ === Arch Linux (Manjaro, Antegros) ===
sudo pacman -S tk
python3.11 pong.py
Disclaimer: Adapted from https://github.com/VissaMoutafis/Pong and from https://www.geeksforgeeks.org/ create-pong-game-using-python-turtle/