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])