Weltkarte: y-Flip der Binary-Koordinaten + Original-Blinken (Punkt<->Kopf)

DOSBox-Nachmessung des blinkenden Level-1-Markers (real (59,153) vs
Binary-Label (53,56)): die Binary-y-Achse ist geflippt (screen_y=209-y).
Alle Pfade/Punkte jetzt an den Original-Positionen (W1 Wald unten, W2/W3
Berge/Schloss -- deckungsgleich mit Stefans Original-/Netz-Screenshots,
Kopf-am-Teich = W1L7). An der aktuellen Position wechseln Punkt und
Mini-Kopf im 0.5s-Rhythmus (Original-Verhalten laut Frame-Diff, die
Referenzbilder zeigen jeweils eine Phase).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 14:31:38 +02:00
co-authored by Claude Fable 5
parent 68be969e0d
commit bca944810e
2 changed files with 53 additions and 8 deletions
+33 -8
View File
@@ -27,7 +27,16 @@ from . import intro
# Mini-Kopf-Sprite je Charakter (KARTE4=Tony, 5=Smacks, 6=Toucan, 7=Coco)
HEAD_SPRITE = {'TONY': 'KARTE4', 'SMACKS': 'KARTE5', 'TOUCAN': 'KARTE6', 'COCO': 'KARTE7'}
STEP_SECONDS = 0.18 # Lauftempo der Kartenfigur pro Wegpunkt
BLINK_SECONDS = 0.5 # orange/blau-Wechsel des aktiven Punkts
BLINK_SECONDS = 0.5 # Blinkrhythmus der aktiven Position
# Die Binary-Koordinaten sind y-GEFLIPPT (DOSBox-Nachmessung 25.07.2026:
# Level-1-Punkt real bei (59,153), Binary-Label (53,56) -> screen_y = 209-y;
# damit liegen die fruehen Level im Wald unten und W2/W3 in Bergen/Schloss
# oben -- deckungsgleich mit Stefans Original-Screenshots).
MAP_Y_FLIP = 209
def _tf(p):
return (p[0], MAP_Y_FLIP - p[1])
def parse_worldmap(exe_path):
@@ -110,6 +119,13 @@ class WorldMap:
f'Fallback nur Level 1', file=sys.stderr)
self.segments = [dict(waypoints=[(113, 35)], stand=(113, 35), label=(108, 51))]
self.names = ['W1L1']
# Positionen ins Screen-System transformieren (y-Flip)
for seg in self.segments:
seg['waypoints'] = [_tf(p) for p in seg['waypoints']]
if seg['stand']:
seg['stand'] = _tf(seg['stand'])
if seg['label']:
seg['label'] = _tf(seg['label'])
self.dot_big_on = intro.make_border_bg_transparent(assets.pcc_surface('KARTE0'))
self.dot_big_off = intro.make_border_bg_transparent(assets.pcc_surface('KARTE2'))
self.dot_small = intro.make_border_bg_transparent(assets.pcc_surface('KARTE3'))
@@ -119,19 +135,28 @@ class WorldMap:
def draw(self, canvas, char, t, walk_pos=None):
canvas.blit(self.karte, (0, 0))
head = self.heads.get(char, self.heads['TONY'])
head_phase = int(t / BLINK_SECONDS) % 2 == 0
for i, seg in enumerate(self.segments):
if seg['label'] is None:
continue
lx, ly = seg['label']
if i == self.current:
dot = self.dot_big_on if int(t / BLINK_SECONDS) % 2 == 0 else self.dot_big_off
if i == self.current and walk_pos is None:
# Original-Verhalten (Netz-Referenzbilder + DOSBox-Diff):
# an der aktuellen Position wechseln PUNKT und MINI-KOPF
if head_phase:
canvas.blit(head, (lx - head.get_width() // 2, ly - head.get_height() // 2))
else:
canvas.blit(self.dot_big_on,
(lx - self.dot_big_on.get_width() // 2,
ly - self.dot_big_on.get_height() // 2))
else:
dot = self.dot_small
canvas.blit(dot, (lx - dot.get_width() // 2, ly - dot.get_height() // 2))
# Spielfigur-Kopf
px, py = walk_pos if walk_pos else self.segments[self.current]['stand']
head = self.heads.get(char, self.heads['TONY'])
canvas.blit(head, (px - head.get_width() // 2, py - head.get_height()))
canvas.blit(dot, (lx - dot.get_width() // 2, ly - dot.get_height() // 2))
# waehrend des Laufens: Kopf entlang des Pfads
if walk_pos is not None:
px, py = walk_pos
canvas.blit(head, (px - head.get_width() // 2, py - head.get_height()))
def run_worldmap(clock, assets, menu_assets, char='TONY', state={}):