Metadata-Version: 2.4
Name: termquest
Version: 1.0.1
Summary: A terminal-native 2D game engine for Python.
Author: TermQuest contributors
License-Expression: MIT
Keywords: terminal,game-engine,2d,tui,multiplayer,p2p,lan,steamworks,eos
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: images
Requires-Dist: Pillow>=10.0; extra == "images"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: twine>=6.0; extra == "dev"
Provides-Extra: steam
Provides-Extra: eos
Dynamic: license-file

# TermQuest

[![CI](https://github.com/kooyoseb/termquest/actions/workflows/ci.yml/badge.svg)](https://github.com/kooyoseb/termquest/actions/workflows/ci.yml)
[![Python](https://img.shields.io/pypi/pyversions/termquest)](https://pypi.org/project/termquest/)
[![PyPI](https://img.shields.io/pypi/v/termquest)](https://pypi.org/project/termquest/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

>  Official GitHub repository: https://github.com/kooyoseb/termquest

TermQuest는 텍스트 어드벤처와 터미널 게임을 위한 작은 Python 게임 프레임워크입니다.

핵심 기능:

- ANSI True Color 기반 터미널 렌더링
- 문자, 픽셀, 박스, 텍스처, 이미지 출력
- 키 입력과 프레임 기반 애니메이션
- 일반 터미널 백엔드
- Tkinter 기반 독립 게임 창 백엔드
- 같은 게임 코드를 콘솔/창 모드로 실행

## 설치

```bash
python -m pip install termquest
```

이미지 로딩 기능:

```bash
python -m pip install "termquest[images]"
```

소스에서 개발용으로 설치할 때는 다음을 사용합니다.

```bash
python -m pip install -e ".[dev,images]"
```

## 실행

```bash
termquest-demo
termquest-demo --window
```

## 최소 예제

```python
from termquest import Game, ConsoleBackend, Color

class MyGame(Game):
    def update(self, dt):
        if self.input.pressed("escape"):
            self.stop()

    def draw(self, screen):
        screen.clear(bg=Color(10, 12, 20))
        screen.text(2, 2, "Hello TermQuest!")

MyGame(ConsoleBackend(60, 20), fps=30).run()
```

창 모드:

```python
from termquest import WindowBackend

MyGame(WindowBackend(60, 20, title="My Game"), fps=30).run()
```

Windows에서 콘솔 창까지 숨기려면 `pythonw.exe game.py`로 실행하거나 패키징 도구에서
콘솔 비활성 옵션을 사용하세요.

## 0.2.0 UI 기능

```python
from termquest import ChoiceMenu, DialogueBox

dialogue = DialogueBox(
    2, 12, 60, 8,
    speaker="안내자",
    text="이 문장을 타이핑 애니메이션으로 표시합니다.",
)
menu = ChoiceMenu(35, 3, 24, ["문을 연다", "돌아간다"])

# update
# dialogue.update(dt, self.input)
# selected = menu.update(self.input)

# draw
# dialogue.draw(screen)
# menu.draw(screen)
```

장면 전환은 `Scene`을 상속한 뒤 `game.set_scene(...)`를 호출합니다.
전체 예제는 `examples/dialogue_adventure.py`에 있습니다.

## JSON 스토리 시스템 (0.3.0)

Python 코드를 작성하지 않고 JSON만으로 대화, 선택지, 분기, 변수, 엔딩을 구성할 수 있습니다.

```bash
termquest-story examples/door_story.json --window
```

기본 구조:

```json
{
  "title": "내 이야기",
  "start": "intro",
  "variables": {"has_key": false},
  "nodes": {
    "intro": {
      "speaker": "안내자",
      "text": "문 앞에 서 있다.",
      "choices": [
        {"text": "문을 연다", "target": "end"}
      ]
    },
    "end": {
      "text": "문이 열렸다.",
      "ending": true
    }
  }
}
```

지원 항목:

- `speaker`: 화자 이름
- `text`: 출력할 대사
- `next`: 대사 완료 후 자동 이동할 노드
- `choices`: 플레이어 선택지
- `set`: 변수 값 변경
- `if`: 선택지 표시 조건
- `ending`: 엔딩 노드 표시


## 0.4.0 — Terminal 2D Engine

TermQuest의 핵심 목표는 **터미널 셀을 픽셀처럼 사용하는 2D 게임 엔진**입니다.

추가된 핵심 시스템:

- `Vec2`, `Rect`와 AABB 충돌
- 월드 좌표와 화면 좌표를 분리하는 `Camera`
- 카메라 추적, 부드러운 이동, 화면 흔들림
- 프레임 애니메이션 `Animation`, 상태 애니메이터 `Animator`
- 렌더링 레이어 `World`, `Layer`
- 문자 기반 `TileMap`, 고체 타일 충돌
- 위치·깊이·가시성·충돌 영역을 가진 `Sprite`

```bash
python examples/terminal_2d_game.py
python examples/terminal_2d_game.py --window
```

## 0.5.0 Gameplay systems

- `PhysicsBody`: velocity, acceleration, gravity, friction and tile collision
- `Entity`: component container around a sprite
- `Timer`: one-shot and repeating timers
- `bar`: terminal HUD bars
- `SaveManager`: JSON save slots

Run the platformer demo:

```bash
python examples/platformer_game.py
python examples/platformer_game.py --window
```

TermQuest 1.0.0부터 문서화된 공개 API에는 시맨틱 버저닝을 적용합니다.

# TermQuest 0.6.0 — UI Framework

0.6.0 adds a keyboard-first UI framework designed for terminal-native 2D games.

## Included widgets

- `UIManager`: focus and input routing
- `Theme`: dark/light palettes
- `Window`, `Panel`, `Label`
- `Button`, `CheckBox`, `Slider`, `TextBox`
- `ProgressBar`
- `VBox`, `HBox`

## UI demo

```bash
python examples/ui_demo.py
python examples/ui_demo.py --window
```

Controls:

- `Tab`, Up, Down: move focus
- Left, Right: adjust sliders or text cursor
- Enter, Space: activate
- Escape: close demo

## Example

```python
from termquest import Button, Theme, UIManager

button = Button(
    2, 2, 18, 3,
    text="Start Game",
    on_click=start_game,
    theme=Theme.dark(),
)
ui = UIManager([button])

# update
ui.update(self.input)

# draw
ui.draw(screen)
```

## Release target

TermQuest `1.0.0` remains the first stable public release. APIs may evolve through
0.9.x; 1.0.0 will establish the stable public interface and compatibility policy.

## 0.7.0 ECS & World

TermQuest 0.7.0 formalizes game objects as entities with reusable components.

```python
from termquest import Entity, Health, Inventory, Sprite, World

world = World()
player = Entity(Sprite.from_text("@"), name="Player", tags={"player"})
player.add(Health(100))
player.add(Inventory(20))
world.add(player, layer="actors")

for entity in world.query(Health):
    print(entity.name, entity.get(Health).current)
```

The first stable public release remains **TermQuest 1.0.0**.

## TermQuest 0.8.0 — Developer Tools

TermQuest 0.8.0 adds the first complete developer-tool workflow:

```bash
termquest new MyGame
cd MyGame
termquest doctor
termquest run
```

Available commands:

- `termquest new NAME` — create a project
- `termquest run [PATH]` — run its `main.py`
- `termquest doctor [PATH]` — inspect the environment and project structure
- `termquest test [PATH]` — run project tests
- `termquest clean [PATH]` — remove Python and pytest caches
- `termquest version` — print the engine version

New public APIs:

- `ProjectConfig`
- `ResourceManager`
- `Plugin` and `PluginManager`
- `create_project`
- `run_doctor`

The plugin API is stable for 1.0.0; platform SDK integrations remain optional bridge packages.

## 0.9.0 Release Candidate

- Public TermQuest exception hierarchy
- File and console logging helpers
- Crash report writer
- Scene load/unload, fixed update, and scene stack
- Performance profiler
- Project validation
- Safer plugin metadata, ordering, dependency checks, and error isolation
- New CLI commands: `validate`, `list-plugins`, `benchmark`, and `info`
- Documentation and TermQuest Dungeon integration example

## 1.0.0 Multiplayer Release

TermQuest 1.0.0 adds a backend-neutral multiplayer layer:

- `MultiplayerSession`, `Transport`, `LobbyProvider`
- `InMemoryP2PTransport` for tests and prototypes
- `UdpP2PTransport` and `LanDiscovery`
- `SteamTransport` / `SteamLobbyProvider` bridge adapters
- `EOSTransport` / `EOSLobbyProvider` bridge adapters
- Reliable/unreliable channels, packet events, JSON helpers, and peer tracking

Steamworks and EOS SDK binaries are intentionally not bundled. Connect them through the bridge protocols in `termquest.platform_network`; see `docs/multiplayer.md` and `examples/multiplayer/`.
