Metadata-Version: 2.4
Name: simple-gamestates
Version: 2
Summary: A simple and abstract state machine manager for Python game development.
Home-page: https://github.com/pozi-dev/simple-gamestates
Author: Pozi
Author-email: pozi@logicbyte.org
License: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Games/Entertainment
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# simple-gamestates

A simple, abstract, and robust **State Machine Manager** designed for modular game development in Python (e.g., Pygame, Arcade).

This library helps organize your game logic by separating different game phases (Menu, Level 1, Pause Screen, Game Over) into distinct, manageable `State` objects.

## Features

* **Stack-based Management:** Easily pause a state (e.g., main game) and push a new state on top (e.g., pause menu), and seamlessly return when popped.
* **Abstract State Interface:** Enforces clear methods (`startup`, `cleanup`, `update`, `draw`, `handle_input`) for structured code.
* **Framework Agnostic:** Designed to integrate with any Python game framework or engine.

## Installation

```bash
pip install simple-gamestates
```

## Usage Example

```python
from pystatemachine.manager import State, StateManager

class MenuState(State):
    def startup(self, data=None):
        print("Menu loaded!")
    
    def update(self, dt):
        # Handle menu animations
        pass
    
    def draw(self, screen):
        # Draw menu background
        pass
        
    def cleanup(self):
        print("Menu exited.")

manager = StateManager()
manager.push_state(MenuState)

# In your main loop:
# manager.update(dt)
# manager.draw(screen)
```

## License

MIT License
