Code repository for "Intro to Pygame" and "Pygame with AI" blog posts.
Christina Kampel
Digital Engineering Fellowship 2023
University of Calgary
- Intro to Pygame: Pygame basics for your first video game!
- Pygame with AI: Using language models in a pygame-based video game!
See what the code does, without the need for installing libraries (may require downloading the mp4 files).
- simple_pygame.py: Companion code for Intro to Pygame - A simple pygame-based video game.
- ai_game.py: Companion code for Pygame with AI - A pygame-based video game with Natural Language Processing (NLP) models that allow the player to talk to non-player characters.
- chat_models.py: Companion code for ai_game.py. Contains the machine learning models used in the game.
The python files above require the following to run:
File(s) | Installation Requirements |
---|---|
simple_pygame.py | - Python: version 3.9.7 or above - Pygame: see the Pygame Getting Started wiki |
ai_game.py chat_models.py |
It is recommended to set up a virtual environment for the following installations: see Installing packages using pip and virtual environments. To ensure all libraries are installed correctly, see the HuggingFace Quicktour. - Python: version 3.9.13 or above - Pygame: see the Pygame Getting Started wiki - Pytorch version 2.0.1 with computing platform CUDA 11.8: see Pytorch website - Requests: see Installing Packages - HuggingFace Transformers: see Transformers installation |
Email: [email protected]
GitHub: Christina-Kampel