From d189a358cd4637ed16654fcb3a23e8b611307339 Mon Sep 17 00:00:00 2001 From: Steven Wroblewski Date: Fri, 2 Oct 2026 13:21:08 +0200 Subject: [PATCH] =?UTF-8?q?Kopf=20der=20Figur=20beh=C3=A4lt=20beim=20Laufe?= =?UTF-8?q?n=20seinen=20Umriss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In zwei der vier Laufbilder hob sich der Körper um ein Pixel, und der dunkle Umriss oben am Kopf fiel aus dem Bild. Laufende Figuren flackerten dadurch am Kopf. Jetzt sinkt der Körper, solange die Beine gespreizt sind, und über dem Kopf bleibt immer eine Zeile frei. Co-Authored-By: Claude Haiku 4.5 --- game/scripts/art/pixel_style.gd | 4 +++- game/tests/test_pixel_style.gd | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/game/scripts/art/pixel_style.gd b/game/scripts/art/pixel_style.gd index 19757ce..4c011d1 100644 --- a/game/scripts/art/pixel_style.gd +++ b/game/scripts/art/pixel_style.gd @@ -440,7 +440,9 @@ func _shadow_image(width: int) -> Pixels: func _figure_image(colour: int, frame: int, left: bool) -> Pixels: var pixels := Pixels.new(FIGURE_SIZE.x, FIGURE_SIZE.y) var shirt := players[colour] - var bob := -1 if frame == 2 or frame == 4 else 0 + # The body sinks a pixel while the legs are apart, so the head always keeps + # a free row above it for its outline. + var bob := 1 if frame == 1 or frame == 3 else 0 # The far leg and the near leg, by frame. var legs: Array[Vector2i] = [Vector2i(6, 9), Vector2i(5, 10), Vector2i(7, 8), Vector2i(10, 5), Vector2i(8, 7)] for leg in 2: diff --git a/game/tests/test_pixel_style.gd b/game/tests/test_pixel_style.gd index 4a6871d..7e5396c 100644 --- a/game/tests/test_pixel_style.gd +++ b/game/tests/test_pixel_style.gd @@ -79,3 +79,12 @@ func test_a_figure_walks_in_four_steps_and_faces_both_ways() -> void: check_eq(left.get_data(), frames[1], "facing left mirrors facing right") var other := style._figure_image(1, 0, false).image check(other.get_data() != frames[0], "another player has another colour") + + +func test_the_head_keeps_its_outline_in_every_step() -> void: + var style := WarmStyle.new() + for frame in 5: + var image := style._figure_image(0, frame, false).image + for x in image.get_width(): + var top := image.get_pixel(x, 0) + check(top.a == 0.0 or top == style.palette["outline"], "frame %d, column %d: %s" % [frame, x, top])