Skip to content

Commit

Permalink
Change sprite to be a hollow box
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcardle committed Jun 12, 2023
1 parent f239ce9 commit cfbfa3e
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions game.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit cfbfa3e

Please sign in to comment.