Three modes, picked up front — and CLASSIC TENNIS is one of them

The setup screen picks WHAT before WHO and WHERE. Three rows out of a table,
in the court row's own markup:

CLASSIC TENNIS is not the opener with the turn switched off and left there —
it is the mode the other two are built on, so it gets real match scoring: six
games with a two-game lead is a set, best of TUNE.classicSets is the match,
the board shows the sets column (hidden until now outside splatter) and the
bar under it says which set this is. The CPU stops rubber-banding and flubs
less: aiFlubLoss exists to get a new player PAST the opener, and a mode whose
whole promise is a real match cannot be won by an opponent that falls apart
the moment he goes ahead. No tiebreak — 6-6 plays on to 8-6. Marked ponytail.

That needed a second ENDING, the one with no corpse in it: G.done, the same
summary and gated tap as the death screen, its own words (GAME, SET, MATCH. /
BEATEN.) and the man still standing. The three endings now share one block
rather than three copies of it.

Caught by the first classic test: stats banked only the FIRST classic run of a
session. `banked` was cleared by the next KILL, and a classic match has no
kills in it at all — every later match was swallowed by the double-bank guard.
beginRun() is the honest reset and restartRun calls it.

ZOMBIE TENNIS from the menu is one line; the back room keeps its door.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
wuwiandClaude Opus 5 committed 2026-08-12 09:27:49 +02:00
1 parent 66fdad3d74
commit c89d4a3ff9
31 files changed
+472 -123

No files matched your search

+22 -2
View File
@@ -9,7 +9,7 @@
# rather than a blurred photo of pixel art.
# Usage: _fine.py sheet.png out1.png out2.png ... [--h 224] [--cut X,Y,...]
import sys
from PIL import Image
from PIL import Image, ImageDraw
import numpy as np
TARGET_H = 224
@@ -22,7 +22,27 @@ def key(im, defringe=2):
bg = a[0, 0, :3].astype(int)
d = ((a[..., :3].astype(int) - bg) ** 2).sum(2)
magenta = np.minimum(a[..., 0], a[..., 2]).astype(int) > a[..., 1].astype(int) + 40
a[(d < KEY_D2) | magenta] = 0
bgish = (d < KEY_D2) | magenta
# ONLY THE OUTSIDE IS BACKGROUND. This used to punch out every magenta pixel on the sheet
# wherever it was, and the generator paints a racket's STRINGS in the backdrop colour more often
# than not — so frame after frame installed a man holding an empty hoop. Background is the region
# CONNECTED TO THE BORDER (which touches_edge already guarantees no figure reaches), so an
# enclosed patch of it inside a racket head is not background and does not become a hole.
# .copy() is load-bearing: an Image.fromarray image is READ-ONLY, and ImageDraw.floodfill's
# first write raises inside its own try/except and returns having filled nothing — a silent
# no-op that looks exactly like "the whole sheet is one figure".
m = Image.fromarray(np.where(bgish, 255, 0).astype('uint8'), 'L').copy()
ImageDraw.floodfill(m, (0, 0), 128)
outside = np.array(m) == 128
if not outside.any(): sys.exit('ERROR: background flood filled nothing — is (0,0) not background?')
a[outside] = 0
# ...and what that leaves — magenta INSIDE a body — is repainted as pale grey rather than kept,
# because bright pink strings are as wrong as no strings. Luminance is preserved, so the drawn
# crosshatch survives as crosshatch; only the hue goes.
inner = magenta & ~outside
if inner.any():
lum = a[..., :3].mean(2)
a[inner, 0] = a[inner, 1] = a[inner, 2] = np.clip(lum[inner] * 0.5 + 115, 0, 255).astype('uint8')
# De-fringe. The generator does not always give you a pure key colour, and whatever it does give
# bleeds a halo one pixel into the sprite — which survives as a magenta rim once the sprite is on
# a green court. Anything on the EDGE that is still leaning towards the background goes too.