termquest 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- termquest-1.0.0/LICENSE +9 -0
- termquest-1.0.0/PKG-INFO +332 -0
- termquest-1.0.0/README.md +300 -0
- termquest-1.0.0/pyproject.toml +53 -0
- termquest-1.0.0/setup.cfg +4 -0
- termquest-1.0.0/src/termquest/__init__.py +68 -0
- termquest-1.0.0/src/termquest/animation.py +69 -0
- termquest-1.0.0/src/termquest/backend.py +173 -0
- termquest-1.0.0/src/termquest/buffer.py +105 -0
- termquest-1.0.0/src/termquest/camera.py +50 -0
- termquest-1.0.0/src/termquest/cli.py +85 -0
- termquest-1.0.0/src/termquest/color.py +32 -0
- termquest-1.0.0/src/termquest/config.py +30 -0
- termquest-1.0.0/src/termquest/crash.py +21 -0
- termquest-1.0.0/src/termquest/demo.py +60 -0
- termquest-1.0.0/src/termquest/doctor.py +23 -0
- termquest-1.0.0/src/termquest/ecs.py +97 -0
- termquest-1.0.0/src/termquest/engine.py +64 -0
- termquest-1.0.0/src/termquest/entity.py +103 -0
- termquest-1.0.0/src/termquest/errors.py +23 -0
- termquest-1.0.0/src/termquest/geometry.py +41 -0
- termquest-1.0.0/src/termquest/hud.py +9 -0
- termquest-1.0.0/src/termquest/image.py +39 -0
- termquest-1.0.0/src/termquest/input.py +98 -0
- termquest-1.0.0/src/termquest/lan.py +155 -0
- termquest-1.0.0/src/termquest/logging.py +24 -0
- termquest-1.0.0/src/termquest/network.py +192 -0
- termquest-1.0.0/src/termquest/p2p.py +52 -0
- termquest-1.0.0/src/termquest/physics.py +51 -0
- termquest-1.0.0/src/termquest/platform_network.py +111 -0
- termquest-1.0.0/src/termquest/plugins.py +59 -0
- termquest-1.0.0/src/termquest/profiler.py +35 -0
- termquest-1.0.0/src/termquest/resources.py +43 -0
- termquest-1.0.0/src/termquest/save.py +21 -0
- termquest-1.0.0/src/termquest/scaffolding.py +18 -0
- termquest-1.0.0/src/termquest/scene.py +88 -0
- termquest-1.0.0/src/termquest/sprite.py +42 -0
- termquest-1.0.0/src/termquest/story.py +215 -0
- termquest-1.0.0/src/termquest/story_runner.py +37 -0
- termquest-1.0.0/src/termquest/tilemap.py +46 -0
- termquest-1.0.0/src/termquest/timer.py +24 -0
- termquest-1.0.0/src/termquest/ui.py +439 -0
- termquest-1.0.0/src/termquest/validation.py +32 -0
- termquest-1.0.0/src/termquest/world.py +64 -0
- termquest-1.0.0/src/termquest.egg-info/PKG-INFO +332 -0
- termquest-1.0.0/src/termquest.egg-info/SOURCES.txt +58 -0
- termquest-1.0.0/src/termquest.egg-info/dependency_links.txt +1 -0
- termquest-1.0.0/src/termquest.egg-info/entry_points.txt +4 -0
- termquest-1.0.0/src/termquest.egg-info/requires.txt +12 -0
- termquest-1.0.0/src/termquest.egg-info/top_level.txt +1 -0
- termquest-1.0.0/tests/test_buffer.py +10 -0
- termquest-1.0.0/tests/test_ecs.py +34 -0
- termquest-1.0.0/tests/test_engine2d.py +19 -0
- termquest-1.0.0/tests/test_gameplay.py +20 -0
- termquest-1.0.0/tests/test_multiplayer_100.py +76 -0
- termquest-1.0.0/tests/test_release_090.py +68 -0
- termquest-1.0.0/tests/test_story.py +35 -0
- termquest-1.0.0/tests/test_tools_080.py +39 -0
- termquest-1.0.0/tests/test_ui.py +24 -0
- termquest-1.0.0/tests/test_ui_framework.py +30 -0
termquest-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 TermQuest contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software.
|
termquest-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: termquest
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A terminal-native 2D game engine for Python.
|
|
5
|
+
Author: TermQuest contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: terminal,game-engine,2d,tui,multiplayer,p2p,lan,steamworks,eos
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Games/Entertainment
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Provides-Extra: images
|
|
24
|
+
Requires-Dist: Pillow>=10.0; extra == "images"
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
28
|
+
Requires-Dist: twine>=6.0; extra == "dev"
|
|
29
|
+
Provides-Extra: steam
|
|
30
|
+
Provides-Extra: eos
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# TermQuest
|
|
34
|
+
|
|
35
|
+
[](https://github.com/OWNER/REPOSITORY/actions/workflows/ci.yml)
|
|
36
|
+
[](https://pypi.org/project/termquest/)
|
|
37
|
+
[](https://pypi.org/project/termquest/)
|
|
38
|
+
[](LICENSE)
|
|
39
|
+
|
|
40
|
+
> GitHub 저장소를 만든 뒤 배지의 `OWNER/REPOSITORY`를 실제 경로로 교체하세요.
|
|
41
|
+
|
|
42
|
+
TermQuest는 텍스트 어드벤처와 터미널 게임을 위한 작은 Python 게임 프레임워크입니다.
|
|
43
|
+
|
|
44
|
+
핵심 기능:
|
|
45
|
+
|
|
46
|
+
- ANSI True Color 기반 터미널 렌더링
|
|
47
|
+
- 문자, 픽셀, 박스, 텍스처, 이미지 출력
|
|
48
|
+
- 키 입력과 프레임 기반 애니메이션
|
|
49
|
+
- 일반 터미널 백엔드
|
|
50
|
+
- Tkinter 기반 독립 게임 창 백엔드
|
|
51
|
+
- 같은 게임 코드를 콘솔/창 모드로 실행
|
|
52
|
+
|
|
53
|
+
## 설치
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python -m pip install termquest
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
이미지 로딩 기능:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
python -m pip install "termquest[images]"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
소스에서 개발용으로 설치할 때는 다음을 사용합니다.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python -m pip install -e ".[dev,images]"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 실행
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
termquest-demo
|
|
75
|
+
termquest-demo --window
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 최소 예제
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from termquest import Game, ConsoleBackend, Color
|
|
82
|
+
|
|
83
|
+
class MyGame(Game):
|
|
84
|
+
def update(self, dt):
|
|
85
|
+
if self.input.pressed("escape"):
|
|
86
|
+
self.stop()
|
|
87
|
+
|
|
88
|
+
def draw(self, screen):
|
|
89
|
+
screen.clear(bg=Color(10, 12, 20))
|
|
90
|
+
screen.text(2, 2, "Hello TermQuest!")
|
|
91
|
+
|
|
92
|
+
MyGame(ConsoleBackend(60, 20), fps=30).run()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
창 모드:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from termquest import WindowBackend
|
|
99
|
+
|
|
100
|
+
MyGame(WindowBackend(60, 20, title="My Game"), fps=30).run()
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Windows에서 콘솔 창까지 숨기려면 `pythonw.exe game.py`로 실행하거나 패키징 도구에서
|
|
104
|
+
콘솔 비활성 옵션을 사용하세요.
|
|
105
|
+
|
|
106
|
+
## 0.2.0 UI 기능
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from termquest import ChoiceMenu, DialogueBox
|
|
110
|
+
|
|
111
|
+
dialogue = DialogueBox(
|
|
112
|
+
2, 12, 60, 8,
|
|
113
|
+
speaker="안내자",
|
|
114
|
+
text="이 문장을 타이핑 애니메이션으로 표시합니다.",
|
|
115
|
+
)
|
|
116
|
+
menu = ChoiceMenu(35, 3, 24, ["문을 연다", "돌아간다"])
|
|
117
|
+
|
|
118
|
+
# update
|
|
119
|
+
# dialogue.update(dt, self.input)
|
|
120
|
+
# selected = menu.update(self.input)
|
|
121
|
+
|
|
122
|
+
# draw
|
|
123
|
+
# dialogue.draw(screen)
|
|
124
|
+
# menu.draw(screen)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
장면 전환은 `Scene`을 상속한 뒤 `game.set_scene(...)`를 호출합니다.
|
|
128
|
+
전체 예제는 `examples/dialogue_adventure.py`에 있습니다.
|
|
129
|
+
|
|
130
|
+
## JSON 스토리 시스템 (0.3.0)
|
|
131
|
+
|
|
132
|
+
Python 코드를 작성하지 않고 JSON만으로 대화, 선택지, 분기, 변수, 엔딩을 구성할 수 있습니다.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
termquest-story examples/door_story.json --window
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
기본 구조:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"title": "내 이야기",
|
|
143
|
+
"start": "intro",
|
|
144
|
+
"variables": {"has_key": false},
|
|
145
|
+
"nodes": {
|
|
146
|
+
"intro": {
|
|
147
|
+
"speaker": "안내자",
|
|
148
|
+
"text": "문 앞에 서 있다.",
|
|
149
|
+
"choices": [
|
|
150
|
+
{"text": "문을 연다", "target": "end"}
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"end": {
|
|
154
|
+
"text": "문이 열렸다.",
|
|
155
|
+
"ending": true
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
지원 항목:
|
|
162
|
+
|
|
163
|
+
- `speaker`: 화자 이름
|
|
164
|
+
- `text`: 출력할 대사
|
|
165
|
+
- `next`: 대사 완료 후 자동 이동할 노드
|
|
166
|
+
- `choices`: 플레이어 선택지
|
|
167
|
+
- `set`: 변수 값 변경
|
|
168
|
+
- `if`: 선택지 표시 조건
|
|
169
|
+
- `ending`: 엔딩 노드 표시
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## 0.4.0 — Terminal 2D Engine
|
|
173
|
+
|
|
174
|
+
TermQuest의 핵심 목표는 **터미널 셀을 픽셀처럼 사용하는 2D 게임 엔진**입니다.
|
|
175
|
+
|
|
176
|
+
추가된 핵심 시스템:
|
|
177
|
+
|
|
178
|
+
- `Vec2`, `Rect`와 AABB 충돌
|
|
179
|
+
- 월드 좌표와 화면 좌표를 분리하는 `Camera`
|
|
180
|
+
- 카메라 추적, 부드러운 이동, 화면 흔들림
|
|
181
|
+
- 프레임 애니메이션 `Animation`, 상태 애니메이터 `Animator`
|
|
182
|
+
- 렌더링 레이어 `World`, `Layer`
|
|
183
|
+
- 문자 기반 `TileMap`, 고체 타일 충돌
|
|
184
|
+
- 위치·깊이·가시성·충돌 영역을 가진 `Sprite`
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
python examples/terminal_2d_game.py
|
|
188
|
+
python examples/terminal_2d_game.py --window
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## 0.5.0 Gameplay systems
|
|
192
|
+
|
|
193
|
+
- `PhysicsBody`: velocity, acceleration, gravity, friction and tile collision
|
|
194
|
+
- `Entity`: component container around a sprite
|
|
195
|
+
- `Timer`: one-shot and repeating timers
|
|
196
|
+
- `bar`: terminal HUD bars
|
|
197
|
+
- `SaveManager`: JSON save slots
|
|
198
|
+
|
|
199
|
+
Run the platformer demo:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
python examples/platformer_game.py
|
|
203
|
+
python examples/platformer_game.py --window
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
TermQuest 1.0.0부터 문서화된 공개 API에는 시맨틱 버저닝을 적용합니다.
|
|
207
|
+
|
|
208
|
+
# TermQuest 0.6.0 — UI Framework
|
|
209
|
+
|
|
210
|
+
0.6.0 adds a keyboard-first UI framework designed for terminal-native 2D games.
|
|
211
|
+
|
|
212
|
+
## Included widgets
|
|
213
|
+
|
|
214
|
+
- `UIManager`: focus and input routing
|
|
215
|
+
- `Theme`: dark/light palettes
|
|
216
|
+
- `Window`, `Panel`, `Label`
|
|
217
|
+
- `Button`, `CheckBox`, `Slider`, `TextBox`
|
|
218
|
+
- `ProgressBar`
|
|
219
|
+
- `VBox`, `HBox`
|
|
220
|
+
|
|
221
|
+
## UI demo
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
python examples/ui_demo.py
|
|
225
|
+
python examples/ui_demo.py --window
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Controls:
|
|
229
|
+
|
|
230
|
+
- `Tab`, Up, Down: move focus
|
|
231
|
+
- Left, Right: adjust sliders or text cursor
|
|
232
|
+
- Enter, Space: activate
|
|
233
|
+
- Escape: close demo
|
|
234
|
+
|
|
235
|
+
## Example
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
from termquest import Button, Theme, UIManager
|
|
239
|
+
|
|
240
|
+
button = Button(
|
|
241
|
+
2, 2, 18, 3,
|
|
242
|
+
text="Start Game",
|
|
243
|
+
on_click=start_game,
|
|
244
|
+
theme=Theme.dark(),
|
|
245
|
+
)
|
|
246
|
+
ui = UIManager([button])
|
|
247
|
+
|
|
248
|
+
# update
|
|
249
|
+
ui.update(self.input)
|
|
250
|
+
|
|
251
|
+
# draw
|
|
252
|
+
ui.draw(screen)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Release target
|
|
256
|
+
|
|
257
|
+
TermQuest `1.0.0` remains the first stable public release. APIs may evolve through
|
|
258
|
+
0.9.x; 1.0.0 will establish the stable public interface and compatibility policy.
|
|
259
|
+
|
|
260
|
+
## 0.7.0 ECS & World
|
|
261
|
+
|
|
262
|
+
TermQuest 0.7.0 formalizes game objects as entities with reusable components.
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
from termquest import Entity, Health, Inventory, Sprite, World
|
|
266
|
+
|
|
267
|
+
world = World()
|
|
268
|
+
player = Entity(Sprite.from_text("@"), name="Player", tags={"player"})
|
|
269
|
+
player.add(Health(100))
|
|
270
|
+
player.add(Inventory(20))
|
|
271
|
+
world.add(player, layer="actors")
|
|
272
|
+
|
|
273
|
+
for entity in world.query(Health):
|
|
274
|
+
print(entity.name, entity.get(Health).current)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
The first stable public release remains **TermQuest 1.0.0**.
|
|
278
|
+
|
|
279
|
+
## TermQuest 0.8.0 — Developer Tools
|
|
280
|
+
|
|
281
|
+
TermQuest 0.8.0 adds the first complete developer-tool workflow:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
termquest new MyGame
|
|
285
|
+
cd MyGame
|
|
286
|
+
termquest doctor
|
|
287
|
+
termquest run
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Available commands:
|
|
291
|
+
|
|
292
|
+
- `termquest new NAME` — create a project
|
|
293
|
+
- `termquest run [PATH]` — run its `main.py`
|
|
294
|
+
- `termquest doctor [PATH]` — inspect the environment and project structure
|
|
295
|
+
- `termquest test [PATH]` — run project tests
|
|
296
|
+
- `termquest clean [PATH]` — remove Python and pytest caches
|
|
297
|
+
- `termquest version` — print the engine version
|
|
298
|
+
|
|
299
|
+
New public APIs:
|
|
300
|
+
|
|
301
|
+
- `ProjectConfig`
|
|
302
|
+
- `ResourceManager`
|
|
303
|
+
- `Plugin` and `PluginManager`
|
|
304
|
+
- `create_project`
|
|
305
|
+
- `run_doctor`
|
|
306
|
+
|
|
307
|
+
The plugin API is stable for 1.0.0; platform SDK integrations remain optional bridge packages.
|
|
308
|
+
|
|
309
|
+
## 0.9.0 Release Candidate
|
|
310
|
+
|
|
311
|
+
- Public TermQuest exception hierarchy
|
|
312
|
+
- File and console logging helpers
|
|
313
|
+
- Crash report writer
|
|
314
|
+
- Scene load/unload, fixed update, and scene stack
|
|
315
|
+
- Performance profiler
|
|
316
|
+
- Project validation
|
|
317
|
+
- Safer plugin metadata, ordering, dependency checks, and error isolation
|
|
318
|
+
- New CLI commands: `validate`, `list-plugins`, `benchmark`, and `info`
|
|
319
|
+
- Documentation and TermQuest Dungeon integration example
|
|
320
|
+
|
|
321
|
+
## 1.0.0 Multiplayer Release
|
|
322
|
+
|
|
323
|
+
TermQuest 1.0.0 adds a backend-neutral multiplayer layer:
|
|
324
|
+
|
|
325
|
+
- `MultiplayerSession`, `Transport`, `LobbyProvider`
|
|
326
|
+
- `InMemoryP2PTransport` for tests and prototypes
|
|
327
|
+
- `UdpP2PTransport` and `LanDiscovery`
|
|
328
|
+
- `SteamTransport` / `SteamLobbyProvider` bridge adapters
|
|
329
|
+
- `EOSTransport` / `EOSLobbyProvider` bridge adapters
|
|
330
|
+
- Reliable/unreliable channels, packet events, JSON helpers, and peer tracking
|
|
331
|
+
|
|
332
|
+
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/`.
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
# TermQuest
|
|
2
|
+
|
|
3
|
+
[](https://github.com/OWNER/REPOSITORY/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/termquest/)
|
|
5
|
+
[](https://pypi.org/project/termquest/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
> GitHub 저장소를 만든 뒤 배지의 `OWNER/REPOSITORY`를 실제 경로로 교체하세요.
|
|
9
|
+
|
|
10
|
+
TermQuest는 텍스트 어드벤처와 터미널 게임을 위한 작은 Python 게임 프레임워크입니다.
|
|
11
|
+
|
|
12
|
+
핵심 기능:
|
|
13
|
+
|
|
14
|
+
- ANSI True Color 기반 터미널 렌더링
|
|
15
|
+
- 문자, 픽셀, 박스, 텍스처, 이미지 출력
|
|
16
|
+
- 키 입력과 프레임 기반 애니메이션
|
|
17
|
+
- 일반 터미널 백엔드
|
|
18
|
+
- Tkinter 기반 독립 게임 창 백엔드
|
|
19
|
+
- 같은 게임 코드를 콘솔/창 모드로 실행
|
|
20
|
+
|
|
21
|
+
## 설치
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python -m pip install termquest
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
이미지 로딩 기능:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python -m pip install "termquest[images]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
소스에서 개발용으로 설치할 때는 다음을 사용합니다.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python -m pip install -e ".[dev,images]"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 실행
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
termquest-demo
|
|
43
|
+
termquest-demo --window
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 최소 예제
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from termquest import Game, ConsoleBackend, Color
|
|
50
|
+
|
|
51
|
+
class MyGame(Game):
|
|
52
|
+
def update(self, dt):
|
|
53
|
+
if self.input.pressed("escape"):
|
|
54
|
+
self.stop()
|
|
55
|
+
|
|
56
|
+
def draw(self, screen):
|
|
57
|
+
screen.clear(bg=Color(10, 12, 20))
|
|
58
|
+
screen.text(2, 2, "Hello TermQuest!")
|
|
59
|
+
|
|
60
|
+
MyGame(ConsoleBackend(60, 20), fps=30).run()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
창 모드:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from termquest import WindowBackend
|
|
67
|
+
|
|
68
|
+
MyGame(WindowBackend(60, 20, title="My Game"), fps=30).run()
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Windows에서 콘솔 창까지 숨기려면 `pythonw.exe game.py`로 실행하거나 패키징 도구에서
|
|
72
|
+
콘솔 비활성 옵션을 사용하세요.
|
|
73
|
+
|
|
74
|
+
## 0.2.0 UI 기능
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from termquest import ChoiceMenu, DialogueBox
|
|
78
|
+
|
|
79
|
+
dialogue = DialogueBox(
|
|
80
|
+
2, 12, 60, 8,
|
|
81
|
+
speaker="안내자",
|
|
82
|
+
text="이 문장을 타이핑 애니메이션으로 표시합니다.",
|
|
83
|
+
)
|
|
84
|
+
menu = ChoiceMenu(35, 3, 24, ["문을 연다", "돌아간다"])
|
|
85
|
+
|
|
86
|
+
# update
|
|
87
|
+
# dialogue.update(dt, self.input)
|
|
88
|
+
# selected = menu.update(self.input)
|
|
89
|
+
|
|
90
|
+
# draw
|
|
91
|
+
# dialogue.draw(screen)
|
|
92
|
+
# menu.draw(screen)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
장면 전환은 `Scene`을 상속한 뒤 `game.set_scene(...)`를 호출합니다.
|
|
96
|
+
전체 예제는 `examples/dialogue_adventure.py`에 있습니다.
|
|
97
|
+
|
|
98
|
+
## JSON 스토리 시스템 (0.3.0)
|
|
99
|
+
|
|
100
|
+
Python 코드를 작성하지 않고 JSON만으로 대화, 선택지, 분기, 변수, 엔딩을 구성할 수 있습니다.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
termquest-story examples/door_story.json --window
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
기본 구조:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"title": "내 이야기",
|
|
111
|
+
"start": "intro",
|
|
112
|
+
"variables": {"has_key": false},
|
|
113
|
+
"nodes": {
|
|
114
|
+
"intro": {
|
|
115
|
+
"speaker": "안내자",
|
|
116
|
+
"text": "문 앞에 서 있다.",
|
|
117
|
+
"choices": [
|
|
118
|
+
{"text": "문을 연다", "target": "end"}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"end": {
|
|
122
|
+
"text": "문이 열렸다.",
|
|
123
|
+
"ending": true
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
지원 항목:
|
|
130
|
+
|
|
131
|
+
- `speaker`: 화자 이름
|
|
132
|
+
- `text`: 출력할 대사
|
|
133
|
+
- `next`: 대사 완료 후 자동 이동할 노드
|
|
134
|
+
- `choices`: 플레이어 선택지
|
|
135
|
+
- `set`: 변수 값 변경
|
|
136
|
+
- `if`: 선택지 표시 조건
|
|
137
|
+
- `ending`: 엔딩 노드 표시
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## 0.4.0 — Terminal 2D Engine
|
|
141
|
+
|
|
142
|
+
TermQuest의 핵심 목표는 **터미널 셀을 픽셀처럼 사용하는 2D 게임 엔진**입니다.
|
|
143
|
+
|
|
144
|
+
추가된 핵심 시스템:
|
|
145
|
+
|
|
146
|
+
- `Vec2`, `Rect`와 AABB 충돌
|
|
147
|
+
- 월드 좌표와 화면 좌표를 분리하는 `Camera`
|
|
148
|
+
- 카메라 추적, 부드러운 이동, 화면 흔들림
|
|
149
|
+
- 프레임 애니메이션 `Animation`, 상태 애니메이터 `Animator`
|
|
150
|
+
- 렌더링 레이어 `World`, `Layer`
|
|
151
|
+
- 문자 기반 `TileMap`, 고체 타일 충돌
|
|
152
|
+
- 위치·깊이·가시성·충돌 영역을 가진 `Sprite`
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
python examples/terminal_2d_game.py
|
|
156
|
+
python examples/terminal_2d_game.py --window
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## 0.5.0 Gameplay systems
|
|
160
|
+
|
|
161
|
+
- `PhysicsBody`: velocity, acceleration, gravity, friction and tile collision
|
|
162
|
+
- `Entity`: component container around a sprite
|
|
163
|
+
- `Timer`: one-shot and repeating timers
|
|
164
|
+
- `bar`: terminal HUD bars
|
|
165
|
+
- `SaveManager`: JSON save slots
|
|
166
|
+
|
|
167
|
+
Run the platformer demo:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
python examples/platformer_game.py
|
|
171
|
+
python examples/platformer_game.py --window
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
TermQuest 1.0.0부터 문서화된 공개 API에는 시맨틱 버저닝을 적용합니다.
|
|
175
|
+
|
|
176
|
+
# TermQuest 0.6.0 — UI Framework
|
|
177
|
+
|
|
178
|
+
0.6.0 adds a keyboard-first UI framework designed for terminal-native 2D games.
|
|
179
|
+
|
|
180
|
+
## Included widgets
|
|
181
|
+
|
|
182
|
+
- `UIManager`: focus and input routing
|
|
183
|
+
- `Theme`: dark/light palettes
|
|
184
|
+
- `Window`, `Panel`, `Label`
|
|
185
|
+
- `Button`, `CheckBox`, `Slider`, `TextBox`
|
|
186
|
+
- `ProgressBar`
|
|
187
|
+
- `VBox`, `HBox`
|
|
188
|
+
|
|
189
|
+
## UI demo
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
python examples/ui_demo.py
|
|
193
|
+
python examples/ui_demo.py --window
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Controls:
|
|
197
|
+
|
|
198
|
+
- `Tab`, Up, Down: move focus
|
|
199
|
+
- Left, Right: adjust sliders or text cursor
|
|
200
|
+
- Enter, Space: activate
|
|
201
|
+
- Escape: close demo
|
|
202
|
+
|
|
203
|
+
## Example
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
from termquest import Button, Theme, UIManager
|
|
207
|
+
|
|
208
|
+
button = Button(
|
|
209
|
+
2, 2, 18, 3,
|
|
210
|
+
text="Start Game",
|
|
211
|
+
on_click=start_game,
|
|
212
|
+
theme=Theme.dark(),
|
|
213
|
+
)
|
|
214
|
+
ui = UIManager([button])
|
|
215
|
+
|
|
216
|
+
# update
|
|
217
|
+
ui.update(self.input)
|
|
218
|
+
|
|
219
|
+
# draw
|
|
220
|
+
ui.draw(screen)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Release target
|
|
224
|
+
|
|
225
|
+
TermQuest `1.0.0` remains the first stable public release. APIs may evolve through
|
|
226
|
+
0.9.x; 1.0.0 will establish the stable public interface and compatibility policy.
|
|
227
|
+
|
|
228
|
+
## 0.7.0 ECS & World
|
|
229
|
+
|
|
230
|
+
TermQuest 0.7.0 formalizes game objects as entities with reusable components.
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
from termquest import Entity, Health, Inventory, Sprite, World
|
|
234
|
+
|
|
235
|
+
world = World()
|
|
236
|
+
player = Entity(Sprite.from_text("@"), name="Player", tags={"player"})
|
|
237
|
+
player.add(Health(100))
|
|
238
|
+
player.add(Inventory(20))
|
|
239
|
+
world.add(player, layer="actors")
|
|
240
|
+
|
|
241
|
+
for entity in world.query(Health):
|
|
242
|
+
print(entity.name, entity.get(Health).current)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The first stable public release remains **TermQuest 1.0.0**.
|
|
246
|
+
|
|
247
|
+
## TermQuest 0.8.0 — Developer Tools
|
|
248
|
+
|
|
249
|
+
TermQuest 0.8.0 adds the first complete developer-tool workflow:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
termquest new MyGame
|
|
253
|
+
cd MyGame
|
|
254
|
+
termquest doctor
|
|
255
|
+
termquest run
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Available commands:
|
|
259
|
+
|
|
260
|
+
- `termquest new NAME` — create a project
|
|
261
|
+
- `termquest run [PATH]` — run its `main.py`
|
|
262
|
+
- `termquest doctor [PATH]` — inspect the environment and project structure
|
|
263
|
+
- `termquest test [PATH]` — run project tests
|
|
264
|
+
- `termquest clean [PATH]` — remove Python and pytest caches
|
|
265
|
+
- `termquest version` — print the engine version
|
|
266
|
+
|
|
267
|
+
New public APIs:
|
|
268
|
+
|
|
269
|
+
- `ProjectConfig`
|
|
270
|
+
- `ResourceManager`
|
|
271
|
+
- `Plugin` and `PluginManager`
|
|
272
|
+
- `create_project`
|
|
273
|
+
- `run_doctor`
|
|
274
|
+
|
|
275
|
+
The plugin API is stable for 1.0.0; platform SDK integrations remain optional bridge packages.
|
|
276
|
+
|
|
277
|
+
## 0.9.0 Release Candidate
|
|
278
|
+
|
|
279
|
+
- Public TermQuest exception hierarchy
|
|
280
|
+
- File and console logging helpers
|
|
281
|
+
- Crash report writer
|
|
282
|
+
- Scene load/unload, fixed update, and scene stack
|
|
283
|
+
- Performance profiler
|
|
284
|
+
- Project validation
|
|
285
|
+
- Safer plugin metadata, ordering, dependency checks, and error isolation
|
|
286
|
+
- New CLI commands: `validate`, `list-plugins`, `benchmark`, and `info`
|
|
287
|
+
- Documentation and TermQuest Dungeon integration example
|
|
288
|
+
|
|
289
|
+
## 1.0.0 Multiplayer Release
|
|
290
|
+
|
|
291
|
+
TermQuest 1.0.0 adds a backend-neutral multiplayer layer:
|
|
292
|
+
|
|
293
|
+
- `MultiplayerSession`, `Transport`, `LobbyProvider`
|
|
294
|
+
- `InMemoryP2PTransport` for tests and prototypes
|
|
295
|
+
- `UdpP2PTransport` and `LanDiscovery`
|
|
296
|
+
- `SteamTransport` / `SteamLobbyProvider` bridge adapters
|
|
297
|
+
- `EOSTransport` / `EOSLobbyProvider` bridge adapters
|
|
298
|
+
- Reliable/unreliable channels, packet events, JSON helpers, and peer tracking
|
|
299
|
+
|
|
300
|
+
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/`.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "termquest"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "A terminal-native 2D game engine for Python."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
authors = [{name = "TermQuest contributors"}]
|
|
12
|
+
license = "MIT"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
dependencies = []
|
|
15
|
+
keywords = [
|
|
16
|
+
"terminal",
|
|
17
|
+
"game-engine",
|
|
18
|
+
"2d",
|
|
19
|
+
"tui",
|
|
20
|
+
"multiplayer",
|
|
21
|
+
"p2p",
|
|
22
|
+
"lan",
|
|
23
|
+
"steamworks",
|
|
24
|
+
"eos",
|
|
25
|
+
]
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Development Status :: 5 - Production/Stable",
|
|
28
|
+
"Environment :: Console",
|
|
29
|
+
"Intended Audience :: Developers",
|
|
30
|
+
"Operating System :: OS Independent",
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
|
+
"Programming Language :: Python :: 3.11",
|
|
35
|
+
"Programming Language :: Python :: 3.12",
|
|
36
|
+
"Programming Language :: Python :: 3.13",
|
|
37
|
+
"Topic :: Games/Entertainment",
|
|
38
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
images = ["Pillow>=10.0"]
|
|
43
|
+
dev = ["build>=1.2", "pytest>=8.0", "twine>=6.0"]
|
|
44
|
+
steam = []
|
|
45
|
+
eos = []
|
|
46
|
+
|
|
47
|
+
[project.scripts]
|
|
48
|
+
termquest = "termquest.cli:main"
|
|
49
|
+
termquest-demo = "termquest.demo:main"
|
|
50
|
+
termquest-story = "termquest.story_runner:main"
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.packages.find]
|
|
53
|
+
where = ["src"]
|