Metadata-Version: 2.4
Name: pygame-foundation
Version: 0.2.2
Summary: A modern wrapper around Pygame.
Author: Arad Rezakhani
License: MIT
Keywords: pygame,game,gamedev,engine,framework
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygame-ce>=2.5
Requires-Dist: termcolor>=3.1
Dynamic: license-file

# Pygame Foundation

**Pygame Foundation** is a lightweight framework built on top of Pygame that provides a structured foundation for building games and interactive applications.

It adds reusable systems for entities, worlds, input, cameras, assets, scenes, collisions, timers, animations, and audio while keeping the underlying Pygame functionality accessible. The current version is **0.2.2**.

## Features

### Core
- `Game` — Main game/application management.
- `World` — Entity and sprite management.
- `Entity` — Base class for game objects.
- Layered rendering.
- Update priorities.
- Pausing and activation states.
- Update intervals.
- Entity tags.

### Input
- Keyboard input.
- Mouse input.
- Input bindings.
- Input contexts.
- Multiple input types.

### Graphics
- Camera management.
- Camera following.
- Camera positioning and movement.

### Assets
- Centralized asset management.
- Image caching.
- Image metadata through `ImageAsset`.
- Image reloading.
- Sound effect management.
- Music management.
- Asset replacement.

### Scenes
- Scene management.
- Scene switching.
- Scene stacking.
- Scene pausing.
- Scene update and draw blocking.
- Scene-specific input contexts.

### Physics
- Collision detection.
- Collision groups and masks.
- Collision callbacks.
- Collision states:
  - `ENTERED`
  - `STAYING`
  - `EXITED`
- Basic AABB collision resolution.

### Timers
- One-shot timers.
- Repeating timers.
- Limited loops.
- Timer cancellation.
- Automatic timer cleanup.

### Animation
- Animation frame management.
- Frame durations.
- Multiple animations.
- Animation switching.
- Animation playback.

### Audio
- Sound effects.
- Sound loops.
- Maximum playback length.
- Volume control.
- Fade-in.
- Fade-out.
- Music playback.
- Music pause and resume.
- Music restarting.
- Music looping.
- Music start positions.
- Music unloading.

## Installation

Install Pygame Foundation with pip:

```bash
pip install pygame-foundation
```

Pygame is required by Pygame Foundation.

## Quick Start

```python
import pygame
from pygame_foundation import Game, Entity

pygame.init()

game = Game()

player = Entity(
    x=100,
    y=100,
)

game.world.add(player)

game.run()
```

See the documentation for the complete API and examples.

## Project Structure

```text
pygame_foundation/
├── animation/
│   ├── __init__.py
│   └── animation.py
├── assets/
│   ├── __init__.py
│   ├── image.py
│   ├── manager.py
│   └── sound.py
├── core/
│   ├── __init__.py
│   ├── constants.py
│   ├── entity.py
│   ├── game.py
│   ├── timer.py
│   └── world.py
├── graphics/
│   ├── __init__.py
│   └── camera.py
├── input/
│   ├── __init__.py
│   └── manager.py
├── physics/
│   ├── __init__.py
│   └── collision.py
├── scene/
│   ├── __init__.py
│   ├── manager.py
│   └── scene.py
└── utils/
    ├── __init__.py
    └── debug.py
```

## Documentation

The complete documentation contains guides and API references for the systems provided by Pygame Foundation.

The documentation covers:

- Core systems
- Entities and worlds
- Input
- Cameras
- Assets
- Scenes
- Collisions
- Timers
- Animations
- Sounds and music

You can find the documentation here: https://aradpython.github.io/pygame-foundation/

## Development

To contribute to Pygame Foundation, clone the repository and install it in editable mode:

```bash
git clone https://github.com/Aradpython/pygame-foundation.git
cd pygame-foundation
pip install -e .
```

All contributions will be looked through, and I thank anyone who contributes. 

## License

Pygame Foundation is released under the **MIT License**.
