cli-arcade 2026.1.2__py3-none-any.whl → 2026.2.0__py3-none-any.whl

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.
cli.py CHANGED
@@ -1,18 +1,17 @@
1
- import curses
1
+ from game_classes import ptk
2
+ from game_classes.tools import verify_terminal_size
2
3
  import os
3
4
  import importlib.util
4
5
  import argparse
5
6
  import glob
6
7
  import sys
7
- import json
8
8
  import re
9
- import subprocess
10
- import urllib.request
9
+ import time
11
10
 
12
11
  # helper: recognize Enter from multiple terminals/keypads
13
12
  def is_enter_key(ch):
14
13
  try:
15
- enter_vals = {10, 13, getattr(curses, 'KEY_ENTER', -1), 343, 459}
14
+ enter_vals = {10, 13, getattr(ptk, 'KEY_ENTER', -1), 343, 459}
16
15
  except Exception:
17
16
  enter_vals = {10, 13}
18
17
  return ch in enter_vals
@@ -52,13 +51,38 @@ def _discover_games():
52
51
  file_to_check = os.path.join(dirpath, pyfiles[0])
53
52
  if not file_to_check:
54
53
  continue
54
+ # try to read declared minimum terminal size from the game file
55
+ min_cols = None
56
+ min_rows = None
57
+ try:
58
+ with open(file_to_check, 'r', encoding='utf-8') as fh:
59
+ src = fh.read()
60
+ m = re.search(r'MIN_TERMINAL\s*=\s*\(\s*(\d+)\s*,\s*(\d+)\s*\)', src)
61
+ if m:
62
+ min_cols = int(m.group(1))
63
+ min_rows = int(m.group(2))
64
+ else:
65
+ m1 = re.search(r'MIN_COLS\s*=\s*(\d+)', src)
66
+ m2 = re.search(r'MIN_ROWS\s*=\s*(\d+)', src)
67
+ if m1:
68
+ min_cols = int(m1.group(1))
69
+ if m2:
70
+ min_rows = int(m2.group(1))
71
+ except Exception:
72
+ min_cols = None
73
+ min_rows = None
55
74
  # use directory name as the display name
56
75
  name = entry.replace('_', ' ').title()
57
76
  rel = os.path.relpath(file_to_check, base).replace('\\', '/')
58
77
  games.append((name, rel))
78
+ try:
79
+ GAME_MINS[rel] = (min_cols, min_rows)
80
+ except Exception:
81
+ pass
59
82
  return games
60
83
 
61
84
 
85
+ GAME_MINS = {}
62
86
  GAMES = _discover_games()
63
87
 
64
88
 
@@ -78,29 +102,29 @@ def _read_console_aliases():
78
102
 
79
103
 
80
104
  def _menu(stdscr):
81
- curses.curs_set(0)
105
+ ptk.curs_set(0)
82
106
  stdscr.nodelay(False)
83
107
  # ensure a cyan color pair is available for the title
84
- if curses.has_colors():
108
+ if ptk.has_colors():
85
109
  try:
86
110
  # init colors
87
- curses.start_color()
88
- curses.use_default_colors()
111
+ ptk.start_color()
112
+ ptk.use_default_colors()
89
113
  # try to normalize key colors (0..1000 scale). Must run before init_pair.
90
- if curses.can_change_color() and curses.COLORS >= 8:
114
+ if ptk.can_change_color() and ptk.COLORS >= 8:
91
115
  try:
92
- curses.init_color(curses.COLOR_MAGENTA, 1000, 0, 1000)
93
- curses.init_color(curses.COLOR_YELLOW, 1000, 1000, 0)
94
- curses.init_color(curses.COLOR_WHITE, 1000, 1000, 1000)
95
- curses.init_color(curses.COLOR_CYAN, 0, 1000, 1000)
96
- curses.init_color(curses.COLOR_BLUE, 0, 0, 1000)
97
- curses.init_color(curses.COLOR_GREEN, 0, 800, 0)
98
- curses.init_color(curses.COLOR_RED, 1000, 0, 0)
99
- curses.init_color(curses.COLOR_BLACK, 0, 0, 0)
116
+ ptk.init_color(ptk.COLOR_MAGENTA, 1000, 0, 1000)
117
+ ptk.init_color(ptk.COLOR_YELLOW, 1000, 1000, 0)
118
+ ptk.init_color(ptk.COLOR_WHITE, 1000, 1000, 1000)
119
+ ptk.init_color(ptk.COLOR_CYAN, 0, 1000, 1000)
120
+ ptk.init_color(ptk.COLOR_BLUE, 0, 0, 1000)
121
+ ptk.init_color(ptk.COLOR_GREEN, 0, 800, 0)
122
+ ptk.init_color(ptk.COLOR_RED, 1000, 0, 0)
123
+ ptk.init_color(ptk.COLOR_BLACK, 0, 0, 0)
100
124
  except Exception:
101
125
  pass
102
126
  for i in range(1,8):
103
- curses.init_pair(i, i, -1)
127
+ ptk.init_pair(i, i, -1)
104
128
  except Exception:
105
129
  pass
106
130
  sel = 0
@@ -110,13 +134,13 @@ def _menu(stdscr):
110
134
  h, w = stdscr.getmaxyx()
111
135
  title_h = len(TITLE)
112
136
  title_start = 0
113
- colors = [curses.COLOR_MAGENTA, curses.COLOR_MAGENTA, curses.COLOR_CYAN, curses.COLOR_CYAN, curses.COLOR_GREEN, curses.COLOR_GREEN]
137
+ colors = [ptk.COLOR_MAGENTA, ptk.COLOR_MAGENTA, ptk.COLOR_CYAN, ptk.COLOR_CYAN, ptk.COLOR_GREEN, ptk.COLOR_GREEN]
114
138
  for i, line in enumerate(TITLE):
115
139
  try:
116
- stdscr.addstr(title_start + i, 0, line, curses.color_pair(colors[i]))
140
+ stdscr.addstr(title_start + i, 0, line, ptk.color_pair(colors[i]))
117
141
  except Exception:
118
142
  pass
119
- stdscr.addstr(title_h + 1, 2, "Use Up/Down, PageUp/PageDown, Enter to start, ESC to quit", curses.color_pair(curses.COLOR_WHITE))
143
+ stdscr.addstr(title_h + 1, 2, "Use Up/Down, PageUp/PageDown, Enter to start, ESC to quit", ptk.color_pair(ptk.COLOR_WHITE))
120
144
  start_y = title_h + 3
121
145
  # number of lines available for the game list
122
146
  avail = max(1, h - start_y - 2)
@@ -130,9 +154,9 @@ def _menu(stdscr):
130
154
  for vis_i in range(min(avail, total)):
131
155
  i = top + vis_i
132
156
  name = GAMES[i][0]
133
- attr = curses.A_REVERSE if i == sel else curses.A_NORMAL
157
+ attr = ptk.A_REVERSE if i == sel else ptk.A_NORMAL
134
158
  try:
135
- stdscr.addstr(start_y + vis_i, 2, name[:w-4], curses.color_pair(curses.COLOR_CYAN) | attr)
159
+ stdscr.addstr(start_y + vis_i, 2, name[:w-4], ptk.color_pair(ptk.COLOR_CYAN) | attr)
136
160
  except Exception:
137
161
  pass
138
162
  # optional scrollbar indicator when list is long
@@ -159,15 +183,34 @@ def _menu(stdscr):
159
183
  stdscr.refresh()
160
184
 
161
185
  ch = stdscr.getch()
162
- if ch == curses.KEY_UP:
186
+ if ch == ptk.KEY_UP:
163
187
  sel = max(0, sel - 1)
164
- elif ch == curses.KEY_DOWN:
188
+ elif ch == ptk.KEY_DOWN:
165
189
  sel = min(len(GAMES) - 1, sel + 1)
166
- elif ch == curses.KEY_PPAGE: # Page Up
190
+ elif ch == ptk.KEY_PPAGE: # Page Up
167
191
  sel = max(0, sel - avail)
168
- elif ch == curses.KEY_NPAGE: # Page Down
192
+ elif ch == ptk.KEY_NPAGE: # Page Down
169
193
  sel = min(len(GAMES) - 1, sel + avail)
170
194
  elif is_enter_key(ch):
195
+ # Before leaving the menu, validate the selected game's minimum
196
+ # terminal size (if declared). If it's too small, show an
197
+ # on-screen message and keep the menu running.
198
+ try:
199
+ rel = GAMES[sel][1]
200
+ mins = GAME_MINS.get(rel)
201
+ if mins:
202
+ min_cols, min_rows = mins
203
+ if min_cols and min_rows and (w < int(min_cols) or h < int(min_rows)):
204
+ try:
205
+ msg = f"Terminal too small: {w}x{h}, need {min_cols}x{min_rows}. Resize to start."
206
+ stdscr.addstr(max(0, h-1), 2, msg[:max(0, w-4)], ptk.color_pair(ptk.COLOR_RED))
207
+ stdscr.refresh()
208
+ time.sleep(1.5)
209
+ except Exception:
210
+ pass
211
+ continue
212
+ except Exception:
213
+ pass
171
214
  return sel
172
215
  elif ch == 27:
173
216
  return None
@@ -178,7 +221,7 @@ def _menu(stdscr):
178
221
  top = sel - avail + 1
179
222
 
180
223
 
181
- def _run_game_by_index(choice):
224
+ def _run_game_by_index(choice, from_menu=False):
182
225
  """Load and run the game given by numeric index in GAMES."""
183
226
  name, relpath = GAMES[choice]
184
227
  base = os.path.dirname(__file__)
@@ -211,7 +254,29 @@ def _run_game_by_index(choice):
211
254
  pass
212
255
  if hasattr(mod, 'main'):
213
256
  try:
214
- curses.wrapper(mod.main)
257
+ # If the module exposes minimum terminal requirements, verify
258
+ # them before entering the alternate screen so messages are visible
259
+ try:
260
+ min_cols = getattr(mod, 'MIN_COLS', None)
261
+ min_rows = getattr(mod, 'MIN_ROWS', None)
262
+ if min_cols is None and hasattr(mod, 'MIN_TERMINAL'):
263
+ t = getattr(mod, 'MIN_TERMINAL')
264
+ if isinstance(t, (tuple, list)) and len(t) >= 2:
265
+ min_cols, min_rows = t[0], t[1]
266
+ if min_cols is not None and min_rows is not None:
267
+ verify_terminal_size(name, int(min_cols), int(min_rows))
268
+ except SystemExit:
269
+ return
270
+ except Exception:
271
+ pass
272
+
273
+ ptk.wrapper(mod.main)
274
+ # If launched via `clia run`, exit the process after the game ends.
275
+ if not from_menu:
276
+ try:
277
+ sys.exit(0)
278
+ except SystemExit:
279
+ raise
215
280
  except Exception as e:
216
281
  print(f" [ERROR] Error running game {name}: {e}")
217
282
  else:
@@ -304,43 +369,6 @@ def _read_version_from_setupcfg():
304
369
  except Exception:
305
370
  return '0.0.0'
306
371
 
307
-
308
- def _version_key(ver):
309
- parts = []
310
- for chunk in re.split(r'(\d+)', ver):
311
- if not chunk:
312
- continue
313
- if chunk.isdigit():
314
- parts.append((0, int(chunk)))
315
- else:
316
- parts.append((1, chunk.lower()))
317
- return parts
318
-
319
-
320
- def _fetch_latest_version(package):
321
- url = f"https://pypi.org/pypi/{package}/json"
322
- try:
323
- with urllib.request.urlopen(url, timeout=5) as resp:
324
- data = json.load(resp)
325
- return data.get('info', {}).get('version')
326
- except Exception as e:
327
- print(f" [ERROR] Failed to check latest version: {e}")
328
- return None
329
-
330
-
331
- def _is_update_available(current, latest):
332
- if not latest:
333
- return False
334
- try:
335
- return _version_key(latest) > _version_key(current)
336
- except Exception:
337
- return latest != current
338
-
339
-
340
- def _run_pip_update(package):
341
- cmd = [sys.executable, '-m', 'pip', 'install', '--upgrade', package]
342
- return subprocess.call(cmd)
343
-
344
372
  def main():
345
373
  # support simple CLI subcommands (e.g. `clia list`)
346
374
  # build epilog with examples and any console script aliases from setup.cfg
@@ -350,7 +378,6 @@ def main():
350
378
  f' %(prog)s list [-h]',
351
379
  f' %(prog)s run [-h] [0, "Byte Bouncer"]',
352
380
  f' %(prog)s reset [-h] [0, "Byte Bouncer"] [-y]',
353
- f' %(prog)s update [--check] [-y]',
354
381
  ]
355
382
  aliases = _read_console_aliases()
356
383
  if aliases:
@@ -390,15 +417,6 @@ def main():
390
417
  )
391
418
  resetp.add_argument('game', nargs='?', help='Optional game name or zero-based index (omit to reset all)')
392
419
  resetp.add_argument('-y', '--yes', action='store_true', help='Do not prompt; proceed with deletion')
393
- updatep = sub.add_parser(
394
- 'update',
395
- help='Update cli-arcade package from PyPI',
396
- description='Check PyPI for a newer version and update if available.',
397
- epilog='Examples:\n %(prog)s\n %(prog)s --check\n %(prog)s -y\n',
398
- formatter_class=argparse.RawDescriptionHelpFormatter,
399
- )
400
- updatep.add_argument('-c', '--check', action='store_true', help='Only check for updates (do not install)')
401
- updatep.add_argument('-y', '--yes', action='store_true', help='Do not prompt; proceed with update')
402
420
  args, _rest = parser.parse_known_args()
403
421
 
404
422
  if args.cmd == 'list':
@@ -440,7 +458,7 @@ def main():
440
458
  return
441
459
  # run the selected game (skip menu)
442
460
  try:
443
- _run_game_by_index(choice)
461
+ _run_game_by_index(choice, from_menu=False)
444
462
  except Exception as e:
445
463
  print(f" [ERROR] Error running game: {e}")
446
464
  return
@@ -472,74 +490,21 @@ def main():
472
490
  _reset_game_by_index(choice, yes=yes)
473
491
  return
474
492
 
475
- if args.cmd == 'update':
476
- package = 'cli-arcade'
477
- current = _read_version_from_setupcfg()
478
- if current == '0.0.0':
479
- print(' [INFO] Installed version not detected (running from source?).')
480
- latest = _fetch_latest_version(package)
481
- if not latest:
482
- print(' [INFO] Unable to determine latest version.')
483
- return
484
- if _is_update_available(current, latest):
485
- print(f" [INFO] Update available: {current} -> {latest}")
486
- if args.check:
487
- return
488
- if not getattr(args, 'yes', False):
489
- ans = input(' [ACTION] Update now? [y/N]: ')
490
- if not ans.lower().startswith('y'):
491
- print(' [CANCELED]')
492
- return
493
- code = _run_pip_update(package)
494
- if code == 0:
495
- print(f" [OK] Updated {package}.")
496
- else:
497
- print(f" [ERROR] Update failed with exit code {code}.")
493
+ # Interactive menu loop: verify terminal size before showing menu each time,
494
+ # run the selected game, then return to the menu when the game exits.
495
+ while True:
496
+ try:
497
+ verify_terminal_size('CLI Arcade', 70, 20)
498
+ except SystemExit:
498
499
  return
499
- print(f" [OK] You are up to date ({current}).")
500
- return
501
-
502
- # run the menu under curses, then launch the chosen game's main()
503
- choice = curses.wrapper(_menu)
504
- if choice is None:
505
- return
506
- name, relpath = GAMES[choice]
507
- base = os.path.dirname(__file__)
508
- path = os.path.join(base, relpath)
509
- if not os.path.exists(path):
510
- print(f" [INFO] Game file not found: {path}")
511
- return
512
- # Ensure the game's directory is on sys.path so local imports (like `highscores`) resolve
513
- game_dir = os.path.dirname(path)
514
- spec = importlib.util.spec_from_file_location(f"cli_game_{choice}", path)
515
- mod = importlib.util.module_from_spec(spec)
516
- inserted = []
517
- try:
518
- proj_root = os.path.dirname(__file__)
519
- if game_dir and game_dir not in sys.path:
520
- sys.path.insert(0, game_dir)
521
- inserted.append(game_dir)
522
- if proj_root and proj_root not in sys.path:
523
- sys.path.insert(0, proj_root)
524
- inserted.append(proj_root)
525
- spec.loader.exec_module(mod)
526
- except Exception as e:
527
- print(f" [INFO] Failed to load game {name}: {e}")
528
- return
529
- finally:
530
- for p in inserted:
531
- try:
532
- sys.path.remove(p)
533
- except Exception:
534
- pass
535
- # call the game's main function if present
536
- if hasattr(mod, 'main'):
500
+ choice = ptk.wrapper(_menu)
501
+ if choice is None:
502
+ break
503
+ # Run the selected game (this returns when the game exits, e.g. ESC)
537
504
  try:
538
- curses.wrapper(mod.main)
505
+ _run_game_by_index(choice, from_menu=True)
539
506
  except Exception as e:
540
- print(f" [ERROR] Error running game {name}: {e}")
541
- else:
542
- print(f" [INFO] Game {name} has no main(stdscr) entry point.")
507
+ print(f" [ERROR] Error running game: {e}")
543
508
 
544
509
 
545
510
  if __name__ == '__main__':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-arcade
3
- Version: 2026.1.2
3
+ Version: 2026.2.0
4
4
  Summary: Collection of terminal CLI games
5
5
  Home-page: https://github.com/Bro-Code-Technologies/cli-arcade/tree/main/windows
6
6
  Author: Bro Code Technologies LLC
@@ -10,7 +10,7 @@ Project-URL: Source, https://github.com/Bro-Code-Technologies/cli-arcade/tree/ma
10
10
  Project-URL: Issues, https://github.com/Bro-Code-Technologies/cli-arcade/tree/main/windows
11
11
  Project-URL: Documentation, https://github.com/Bro-Code-Technologies/cli-arcade/tree/main/windows
12
12
  Project-URL: Package, https://pypi.org/project/cli-arcade/
13
- Keywords: cli,terminal,arcade,games,curses
13
+ Keywords: cli,terminal,arcade,games
14
14
  Classifier: Development Status :: 4 - Beta
15
15
  Classifier: Environment :: Console
16
16
  Classifier: Intended Audience :: End Users/Desktop
@@ -28,17 +28,17 @@ Requires-Python: >=3.8
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  Requires-Dist: appdirs
31
- Requires-Dist: windows-curses; sys_platform == "win32"
31
+ Requires-Dist: prompt_toolkit
32
32
  Dynamic: license-file
33
33
 
34
34
  # CLI Arcade
35
35
 
36
36
  Collection of small terminal games bundled with a single CLI launcher.
37
37
 
38
- Requirements
38
+ ## Requirements
39
39
  - Python 3.8+
40
40
 
41
- Quick start
41
+ ## Quick start
42
42
  ```powershell
43
43
  # list installed console aliases and available games
44
44
  clia list
@@ -54,23 +54,45 @@ clia run "Byte Bouncer"
54
54
  clia reset 0
55
55
  clia reset "Byte Bouncer"
56
56
  clia reset -y # skip confirmation
57
-
58
- # check for updates and optionally update
59
- clia update
60
- clia update --check # only check for updates
61
- clia update -y # skip confirmation
62
57
  ```
63
58
 
64
- Commands
65
- - `clia` — interactive curses menu
59
+ ## Commands
60
+ - `clia` — interactive terminal menu
66
61
  - `clia list` — print available games and zero-based indices
67
62
  - `clia run <index|name>` — run a game directly (index is zero-based)
68
63
  - `clia reset [<index|name>] [-y]` — delete highscores for a game or all games
69
- - `clia update [--check] [-y]` — check for updates and optionally update
70
64
  - Aliases available: `cli-arcade`
71
65
 
72
- License
66
+ ## License
73
67
  - MIT
74
68
 
75
- Changelog
76
- - See CHANGELOG.md
69
+ # Changelog
70
+
71
+ All notable changes to this project will be documented in this file.
72
+
73
+ ## 2026.0.0
74
+ - Initial release as CLI Game.
75
+
76
+ ## 2026.1.0
77
+ - Project renamed to CLI Arcade.
78
+ - Packaging metadata updated for PyPI.
79
+ - Documentation refresh.
80
+
81
+ ### 2026.1.1
82
+ - Updated TITLE ASCII art.
83
+ - Added `clia update` command to check for and install updates from PyPI.
84
+ - (YANKED)
85
+
86
+ ### 2026.1.2 (YANKED)
87
+ - Version bump for testing the update mechanism.
88
+
89
+ ### 2026.1.3
90
+ - Removed `clia update` command.
91
+
92
+ ### 2026.2.0
93
+ - Refactoring using `prompt_toolkit` replacing `windows-curses` for better cross-platform compatibility.
94
+ - Restore/clear alternate screen on run/exit (no UI artifacts).
95
+ - Centralize terminal-size checks in CLI; games expose `MIN_COLS`/`MIN_ROWS`.
96
+ - Byte Bouncer & Star Ship: floor + off-screen right wall; left-column bug fixed.
97
+ - `ptk`: default-attribute/color emission fix; add helper to exit alt screen.
98
+ - Fixed 180 movement glitch in Star Ship.
@@ -0,0 +1,41 @@
1
+ cli.py,sha256=sf70SoYU89X2b5CENYvqC7z8KntRadlV3IQHJXrgkw0,19567
2
+ cli_arcade-2026.2.0.dist-info/licenses/LICENSE,sha256=1PLSNFyGPi9COkVEeNYcUTuRLqGxzMLLTah05tByD4s,1099
3
+ game_classes/__init__.py,sha256=A0o4vBUktOiONToIJb0hACalszBnFS9ls9WXPn3-KH0,28
4
+ game_classes/game_base.py,sha256=8OaMHwPE6KKhwRCbUoI0Kypf2CN6RVxze_zdqaw7HhE,3499
5
+ game_classes/highscores.py,sha256=dDK-7lFXSMwIqExXGp6_-7QfQz6CIf12lJ22poeCdh4,4061
6
+ game_classes/menu.py,sha256=wx-dITSozG1VCfyFeFKgooRXEijQygDCTBRvoKnd7-8,2798
7
+ game_classes/ptk.py,sha256=CpbE7KJ3HXTRuaeMJSIMEfGzcwjmPMtURjyHPOFWVoY,8119
8
+ game_classes/tools.py,sha256=sZR4m8NSil4UhmZ2qDsl1iEi1hZMwUPVBFR5hSmiEBc,5106
9
+ game_classes/__pycache__/__init__.cpython-313.pyc,sha256=zSl9ESMUQn5Vo_XXAA8DD7lpFHOtOwBruGvCOJ5qeuo,192
10
+ game_classes/__pycache__/game_base.cpython-313.pyc,sha256=NKAgCBXxM7nZ8mt6wFy1MxUW6DK7EBhqXiLr1sVmtiA,6977
11
+ game_classes/__pycache__/highscores.cpython-313.pyc,sha256=0rYMYs6NOzT-f00Me20F-46kUR_x8ZXk2jngO5amLy4,7080
12
+ game_classes/__pycache__/menu.cpython-313.pyc,sha256=urqSfGlJJdfTKI1kqXOT0oPXjo1Ny9MyYA8QroVQHzQ,4488
13
+ game_classes/__pycache__/ptk.cpython-313.pyc,sha256=ZTwAGo3hlFRhk5rNbLiUBOMmR_odse9v_XTkHXdjxpw,14412
14
+ game_classes/__pycache__/ptk_curses.cpython-313.pyc,sha256=XqhJ78tqyT0HFd5UV_1_IrGl-W5PuW4WyJve5RiY3uo,13820
15
+ game_classes/__pycache__/ptk_game_base.cpython-313.pyc,sha256=tRzGtoCErAHsUpoEWVjQN4PQ0Gw5N9RW3nJHJW2IT24,6915
16
+ game_classes/__pycache__/ptk_menu.cpython-313.pyc,sha256=jyBSuLVxNm7ueGjAIKhd7D_ZEFpwLv9U1iim_ElClHk,2448
17
+ game_classes/__pycache__/ptk_tools.cpython-313.pyc,sha256=Y-lBpAMlt8HfgQEio4isDGpwXclYUsyzs9wGoeGJkmE,5061
18
+ game_classes/__pycache__/tools.cpython-313.pyc,sha256=0MS9Cai_D0LaIQ6w6c6BLSJ45XvnUr4BjHSQdFYnQ7Y,7316
19
+ games/__init__.py,sha256=Rg46lnLj_sezpnXaQTS1NXX5OaRhR_EWpNTyYUxycj4,21
20
+ games/byte_bouncer/__init__.py,sha256=8hxIHRyUPB-X6vJXh1432ytKjOcfIzCbdpO5mmWA7iQ,33
21
+ games/byte_bouncer/game.py,sha256=EpTzObLNF_cGfB-xRkUlqCwYt7A7IGk8nENkOdqoV3c,8877
22
+ games/byte_bouncer/__pycache__/byte_bouncer.cpython-313.pyc,sha256=JSTB6-_KCukAAVaZz9TpJ3V4gif_M3n_L5X1KOviSJ8,24605
23
+ games/byte_bouncer/__pycache__/game.cpython-313.pyc,sha256=0H66QPFncbxvKVlMRPKEXjJDYtw1pPAw5I9sz3kWdIA,13965
24
+ games/byte_bouncer/__pycache__/highscores.cpython-313.pyc,sha256=g3FozKpWGDVsTVETNpb6lRHcKA3ZIsQio8Kh7KCGVCI,3125
25
+ games/star_ship/__init__.py,sha256=X8AdhoccmNVu6yl7MalsxIsMxuEsddRdlvEQmhZMD0A,30
26
+ games/star_ship/game.py,sha256=aN3LVh-kaYppAy-J259Y6XROT5pvEAFDjGd1404oWBw,10992
27
+ games/star_ship/__pycache__/game.cpython-313.pyc,sha256=hWqwV12a1VF-_Lc8Uzd7ono4ZN3gNJ4RQ-gK69OayVw,15922
28
+ games/star_ship/__pycache__/highscores.cpython-313.pyc,sha256=nHbEOTWeX0U9D47K2EP5S5uDPI0WW52Eg7h_NesG1OU,3148
29
+ games/star_ship/__pycache__/nibbles.cpython-313.pyc,sha256=Yv2P-GwEc30zA24aO7k0hkk1AOja6K85AFvmjLIffqQ,20510
30
+ games/star_ship/__pycache__/snek.cpython-313.pyc,sha256=3Mwyy6vjGFRmNyAWSqV5JRilLOxiCSndBmwua_Y7VTs,13313
31
+ games/star_ship/__pycache__/star_ship.cpython-313.pyc,sha256=9gJt10MTzVTSwsc4I16TDZTaAXclfhfGTzgfYgZNOKo,28021
32
+ games/terminal_tumble/__init__.py,sha256=axTd7hCgnLRNU8QS73NnQY3q5xjIb3ZYQORJ9Lz8l_E,36
33
+ games/terminal_tumble/game.py,sha256=UbtrMS4wi5MiIMHfreP51VlrHHlfxEPJpFmsLgdUgWs,15633
34
+ games/terminal_tumble/__pycache__/game.cpython-313.pyc,sha256=DrjmLzJYY5QoYXghGh-ORn26Yax9Gmd6fSCZGdgYbRQ,24073
35
+ games/terminal_tumble/__pycache__/highscores.cpython-313.pyc,sha256=UPnU9Zq88q2TZq1qXyo8e2Y_PdOgwvu5mncIkunFah8,3154
36
+ games/terminal_tumble/__pycache__/terminal_tumble.cpython-313.pyc,sha256=7oLpmmkYjpLYRC0bjRoEkHbIUNq7FZVJToGoja94m0o,38016
37
+ cli_arcade-2026.2.0.dist-info/METADATA,sha256=dBo3dzuaIBHOOOKkyi8NMZw7OacdGshIWdDEtMKZ5Ik,3229
38
+ cli_arcade-2026.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
39
+ cli_arcade-2026.2.0.dist-info/entry_points.txt,sha256=nNElhZv4nM_lrOYpvnOChtJn1XsWwQr8sI344flzzTQ,56
40
+ cli_arcade-2026.2.0.dist-info/top_level.txt,sha256=gTfYlz7gHYgPY0ugfJivukCOkNzmOisNR6VuJjAXPF4,23
41
+ cli_arcade-2026.2.0.dist-info/RECORD,,
game_classes/game_base.py CHANGED
@@ -1,9 +1,9 @@
1
- import curses
1
+ from game_classes import ptk
2
2
  import time
3
3
  from game_classes.tools import get_terminal_size
4
4
 
5
5
  class GameBase:
6
- def __init__(self, stdscr, player_name, tick, color=curses.COLOR_GREEN):
6
+ def __init__(self, stdscr, player_name, tick, color=ptk.COLOR_GREEN):
7
7
  self.stdscr = stdscr
8
8
  self.player_name = player_name
9
9
  self.tick = tick
@@ -65,7 +65,7 @@ class GameBase:
65
65
  return True
66
66
  if not getattr(self, 'over', False):
67
67
  # toggle pause on Backspace
68
- if ch in (curses.KEY_BACKSPACE, 127, 8):
68
+ if ch in (ptk.KEY_BACKSPACE, 127, 8):
69
69
  self.paused = not getattr(self, 'paused', False)
70
70
  # movement only when not paused
71
71
  elif not getattr(self, 'paused', False):
@@ -76,7 +76,7 @@ class GameBase:
76
76
  try:
77
77
  py = max(0, min(self.height, self.height // 2))
78
78
  px = max(0, (self.width - len(msg)) // 2)
79
- self.stdscr.addstr(py, px, msg, curses.color_pair(curses.COLOR_RED) | curses.A_BOLD)
79
+ self.stdscr.addstr(py, px, msg, ptk.color_pair(ptk.COLOR_RED) | ptk.A_BOLD)
80
80
  except Exception:
81
81
  pass
82
82
 
@@ -85,7 +85,7 @@ class GameBase:
85
85
  try:
86
86
  for i, line in enumerate(self.title):
87
87
  try:
88
- self.stdscr.addstr(i, 0, line, curses.color_pair(self.color) | curses.A_BOLD)
88
+ self.stdscr.addstr(i, 0, line, ptk.color_pair(self.color) | ptk.A_BOLD)
89
89
  except Exception:
90
90
  pass
91
91
  except Exception:
game_classes/menu.py CHANGED
@@ -1,4 +1,4 @@
1
- import curses
1
+ from game_classes import ptk
2
2
  from game_classes.tools import is_enter_key
3
3
 
4
4
  class Menu:
@@ -19,7 +19,7 @@ class Menu:
19
19
  return name.strip() or 'Player'
20
20
  elif ch in (27,):
21
21
  return False
22
- elif ch in (curses.KEY_BACKSPACE, 127, 8):
22
+ elif ch in (ptk.KEY_BACKSPACE, 127, 8):
23
23
  name = name[:-1]
24
24
  elif 32 <= ch <= 126 and len(name) < max_len:
25
25
  name += chr(ch)
@@ -34,7 +34,7 @@ class Menu:
34
34
  title_height = len(self.game.title)
35
35
  for i, line in enumerate(self.game.title):
36
36
  try:
37
- self.game.stdscr.addstr(i, 0, line, curses.color_pair(self.game.color) | curses.A_BOLD)
37
+ self.game.stdscr.addstr(i, 0, line, ptk.color_pair(self.game.color) | ptk.A_BOLD)
38
38
  except Exception:
39
39
  pass
40
40
 
@@ -51,7 +51,7 @@ class Menu:
51
51
  self.game.stdscr.refresh()
52
52
  while True:
53
53
  ch = self.game.stdscr.getch()
54
- # if ch in (ord('s'), ord('S')) or ch == curses.KEY_DOWN:
54
+ # if ch in (ord('s'), ord('S')) or ch == ptk.KEY_DOWN:
55
55
  if is_enter_key(ch):
56
56
  # prompt for name before starting, centered over the title block
57
57
  prompt_y = title_height + 3