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.8.tar.gz (42.2 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.8-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygame_tutor-0.1.8.tar.gz
  • Upload date:
  • Size: 42.2 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.8.tar.gz
Algorithm Hash digest
SHA256 4bdb3b4d3b182bce6f35c25ccebfe8671f5b8532158e54d59cdf307c093ac0a5
MD5 73396583c2cc3922dc7f045e94f4faee
BLAKE2b-256 7b410262ff344d74a20630d469ca214925c515cea7ecdf15bad9472038ef696e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygame_tutor-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 49.0 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f916c77f3a3e4a61e62126b846d1095b2a1ea95babd080e63c01daf7285f7264
MD5 b236e4a8953a2054c5ae444a2998f0ee
BLAKE2b-256 096cb1bc65f72f86c67486fe0a3a0fc023117dda06d89479c043673ef087c93b

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