Skip to main content

Interactive educational platform for learning Pygame

Project description

🎮 Pygame Tutor

License: GPL v3

An interactive playground for learning Python through Pygame. Designed for learners and educators, this project features modular, visual lessons that teach core programming concepts through hands-on fun.

screenshot pygame-tutor


✨ Features

  • Interactive Lessons:

    • 🚀 Comet animation with trails
    • ⚛️ Physics: gravity + bouncing balls
    • ⌨️ Key input visualizer
    • 🧱 Breakout and Arkanoid clones
  • Learning-Oriented Tools:

    • 📜 Toggleable real-time code viewer (S)
    • 💡 In-lesson explanations
    • ↔️ Navigation between lessons
  • Built for Devs:

    • 🧩 Modular architecture (pygametutor/)
    • 🎨 Color-themed rendering
    • 📐 Auto-scaling screen support

🚀 Installation

Install via uv or regular pip:

uv tool install pygame-tutor
# or
uv pip install pygame-tutor
# or
pip install pygame-tutor

Run with:

pygame-tutor

🕹️ Controls

  • ← →: Navigate between lessons
  • S: Toggle code viewer
  • Q / ESC: Quit
  • Lesson-specific controls are displayed in each lesson.

📚 Lessons

Lesson Description Concepts
Cosmic Comet Rainbow comet trail animation Animation loop, trails, movement
Physics Playground Gravity + collisions Physics, collisions, vector math
Key Detection Lab Input visualizer Events, key handling, rendering
Breakout Game Brick-breaking with paddle State, collisions, win/loss logic

🧑‍💻 Create a Lesson

To add your own:

  1. Inside pygametutor/lessons/, create a file:

    lesson_06_myfeature.py
    
  2. Add your class:

from pygametutor.core.base import BaseLesson

class Lesson06Myfeature(BaseLesson):
    def __init__(self, screen_geo):
        super().__init__(screen_geo)
        self.title = "My New Lesson"

    def update(self, dt):
        pass  # Update state

    def draw(self):
        pass  # Draw everything

    def handle_events(self, event):
        pass  # React to input
  1. It will be loaded automatically at startup.

🎨 Color Palette

Based on the Tokyo Night theme:

{
    "background": (26, 27, 38),
    "text": (169, 177, 214),
    "highlight": (122, 162, 247),
    "accent": (158, 206, 106),
    "Orange": (255, 179, 0),
    "Purple": (204, 153, 255)
}

🧩 Project Structure

pygametutor/
├── core/         # Engine components
├── lessons/      # Each lesson = one file
├── settings/     # Constants & paths
└── main.py       # Entry point (called by CLI)

🛠 For Developers

  • 🐍 Python 3.8+

  • 📦 Dependencies managed via uv or pip

  • 🧪 Test locally:

    uv pip install -e .
    pygame-tutor
    

📜 License

Licensed under the GNU General Public License v3.0. See LICENSE for details.

"Learn by doing" — Pygame Tutor turns code into creativity.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygame_tutor-0.1.7.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygame_tutor-0.1.7-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file pygame_tutor-0.1.7.tar.gz.

File metadata

  • Download URL: pygame_tutor-0.1.7.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pygame_tutor-0.1.7.tar.gz
Algorithm Hash digest
SHA256 be3bafe46df94ce5313f4aac511c90071f947356558f018d4a2936c0024311bf
MD5 3c10c86274d9911bad3cbe2f2128c049
BLAKE2b-256 73da173cc9db5fe354de39c39f00936ccea9db2b391bef846663aab5a8b98faf

See more details on using hashes here.

File details

Details for the file pygame_tutor-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pygame_tutor-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pygame_tutor-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed0b078799014611ff9959228aa8ab3f5c0744e0ad54c5feda26e7af4453f97
MD5 ba30bd4d2fafb763297f021eb1ecc8a1
BLAKE2b-256 753f493b65e90f8bd63497c01acf5bb2febfb0e939a07bbcfdf8a254595ffa56

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page