This is a python project that makes an interactable desktop pet with animations. Pets are customizable, can have arbitrary amounts of animations, and can easily be added. When run, the pets will cycle animations, move around the sreen by themselve, or be moved by the user's mouse.
To add a new pet one must:
- Add a new pet in the pets element in the
config.xml
- Add either
.gif
or.png
files to thesrc/sprites/{pet_name}
folder for each animation - Define the different animation states the new pet has in
src/animations.py
as a new function and add it tosrc.animations.get_animations
. Look at the examples ofsrc.animations.get_cat_animations
andsrc.animations.get_horse_animations
functions for help. - Update the defualt pet in the
config.xml
to the pet you just made
After those 4 steps simply run the project and you should see your pet on your desktop!
python3 -m venv venv
.\venv\Scripts\activate.ps1
pip install -r requirements.txt
python run.py
We are using pyinstaller to create and bundle the stand alone executable. To create a new executable after changing files simply call pyinstaller run.spec
while in the venv and the project's root directory. The bundled executable will be in the \dist\DesktopPet
folder.
File Not Found Exception? Data files, non-python dependencies such as images, must be added explicitly in the run.spec
file. So, if you added such a file that is not in src/sprites
you must add it to the datas
array in run.spec
.