From cfbfa3eb0ef8c49e7cbdb55be85484d2bd4edbf6 Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Sun, 11 Jun 2023 20:58:54 -0400 Subject: [PATCH] Change sprite to be a hollow box --- game.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/game.c b/game.c index 59b5a52..9cd6a8a 100644 --- a/game.c +++ b/game.c @@ -88,16 +88,26 @@ ball_t ball_tick(ball_t ball) { void ball_draw(ball_t ball) { move_sprite(0, ball.x.pos, ball.y.pos); } -// The tile is 8x8 pixels with two bits per pixel. +// The tile is 8x8 pixels with two bits per pixel. Surprisingly, the two bits +// that make up a pixel are not sequential within a byte; instead, the pixel's +// value is composed of the ith bit from bytes n and n+1 (for even values of n). const uint8_t kSpriteTile[16] = { - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // - 0b11111111, 0b11111111, // + 0b11111111, // + 0b11111111, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b10000001, // + 0b11111111, // + 0b11111111, // }; int main() {