For only play open releases in right side and download flappy-bird.zip
This version of flappy bird written with PyGame library.
Video Tutorial - Youtube
References of images and sound can be found there: Github repo
First, use venv or conda for your project environment. I use venv for each of my separate python projects, so each project becomes mobile and standalone and the main environment is not filled with packages
Open project in terminal and type:
python3 -m venv .env
python -m venv .env
source .env/Scripts/activate.bat
source .env/bin/activate
After activation should be added in front of the terminal (.env)
deactivate
More about venv: venv documentation
After enter to venv, just install some packages for lauch game
Use the package manager pip to install requirements.txt.
pip install requirements.txt
Write this for check packages:
pip freeze
Output something like this:
altgraph==0.17
future==0.18.2
pefile==2019.4.18
pygame==1.9.6
pyinstaller==4.0
pyinstaller-hooks-contrib==2020.8
pywin32-ctypes==0.2.0
For generate .exe file we use packet pyinstaller
Open project folder and enter to venv and type:
pyinstaller --clean -F -w -i=icon.ico --add-data="assets;assets" --add-data="sounds;sounds" --add-data="fonts;fonts" -n flappy-bird main.py
# --clean - for clear pyinstaller cache
# -F - one file output
# -w - without console (windowed)
# -i - icon for file, used with path to .ico
# --add-data - adding files to complete .exe, file name must be same as in your project
# -n - name of exe
# main.py - python file source
pyinstaller -F -w --add-data="assets:assets" --add-data="sounds:sounds" --add-data="fonts:fonts" -n flappy-bird main.py
# -i - icon can not be used in Linux
.exe file can be found in pygame-flappy-bird/dist/flappy-bird.exe
/pygame-flappy-bird ┬ ├ .env ├ assets ├ build ├ dist ┬ ├ flappy-bird.exe ├ fonts ├ sounds ├ .gitignore ├ flappy-bird.spec ├ icon.ico ├ main.py ├ README.md ├ requirements.txt
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.