Welcome to Serenity Valley Game
Serenity Valley Game is a demonstration project built with pygame that showcases a collection of custom UI widgets, interactive elements, and utility classes for building 2D games in Python.Get Started
Set up and run the game in minutes
Explore Widgets
Discover interactive UI components
Learn Utilities
Master 2D vector math and timers
API Reference
Complete API documentation
Key Features
Custom UI Widgets
Pre-built components including Box, MessageBoard, Button, Images, and text entry fields
2D Vector Mathematics
Comprehensive vec2d class with operations, rotations, and geometric utilities
Interactive Elements
Toggle buttons, text entry, and mouse click event handling
Animation System
SimpleAnimation class for sprite-based animations with timers
Moving Objects
Animated rectangles and images with collision detection
Grid-Based Layout
Coordinate conversion system for grid-based game fields
What You’ll Learn
This project demonstrates fundamental pygame concepts:- Setting up a game loop with frame limiting
- Creating reusable UI widget classes
- Handling user input (keyboard and mouse)
- Managing game state with pause/resume functionality
- Drawing and updating sprites and shapes
- Using timer utilities for periodic callbacks
This project is based on examples from Eli Thegreenplace’s pygame tutorial series.
Quick Example
Here’s a simple example of creating a button widget:game.py
Next Steps
Quickstart Guide
Install pygame and run the game
Architecture Overview
Understand the project structure