diff --git a/cart/snake/game.dll b/cart/snake/game.dll index f87bf4d..c0008ac 100644 --- a/cart/snake/game.dll +++ b/cart/snake/game.dll Binary files differ diff --git a/cart/snake/game.dll b/cart/snake/game.dll index f87bf4d..c0008ac 100644 --- a/cart/snake/game.dll +++ b/cart/snake/game.dll Binary files differ diff --git a/cart/test/game.dll b/cart/test/game.dll new file mode 100644 index 0000000..6b98548 --- /dev/null +++ b/cart/test/game.dll Binary files differ diff --git a/cart/snake/game.dll b/cart/snake/game.dll index f87bf4d..c0008ac 100644 --- a/cart/snake/game.dll +++ b/cart/snake/game.dll Binary files differ diff --git a/cart/test/game.dll b/cart/test/game.dll new file mode 100644 index 0000000..6b98548 --- /dev/null +++ b/cart/test/game.dll Binary files differ diff --git a/cart/test/player.pbm b/cart/test/player.pbm new file mode 100644 index 0000000..a68ece6 --- /dev/null +++ b/cart/test/player.pbm Binary files differ diff --git a/cart/snake/game.dll b/cart/snake/game.dll index f87bf4d..c0008ac 100644 --- a/cart/snake/game.dll +++ b/cart/snake/game.dll Binary files differ diff --git a/cart/test/game.dll b/cart/test/game.dll new file mode 100644 index 0000000..6b98548 --- /dev/null +++ b/cart/test/game.dll Binary files differ diff --git a/cart/test/player.pbm b/cart/test/player.pbm new file mode 100644 index 0000000..a68ece6 --- /dev/null +++ b/cart/test/player.pbm Binary files differ diff --git a/snake/snake.c b/snake/snake.c index 0a2d9d9..71df46b 100755 --- a/snake/snake.c +++ b/snake/snake.c @@ -270,7 +270,7 @@ { if (board[INDEX(x, y)] == BLOCK) { - d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, block, 0, 0, 0, 0, BLACK, WHITE); + d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, block, 0, 0, 0, 0, BLACK, WHITE, R_NONE); } } } @@ -312,7 +312,7 @@ if (yOrder != 0 || fruitFlashTimer > 0) { - d_pbm(x, y, fruit[level_fruit[i]], 0, 0, 0, 0, BLACK, WHITE); + d_pbm(x, y, fruit[level_fruit[i]], 0, 0, 0, 0, BLACK, WHITE, R_NONE); } } @@ -339,7 +339,7 @@ coords(i, &x, &y); printf("Fruit_%d at %d, index %d: %dx%d\n", fruit_type, r, i, x, y); - d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, fruit[fruit_type], 0, 0, 0, 0, BLACK, WHITE); + d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, fruit[fruit_type], 0, 0, 0, 0, BLACK, WHITE, R_NONE); emptyTiles--; diff --git a/cart/snake/game.dll b/cart/snake/game.dll index f87bf4d..c0008ac 100644 --- a/cart/snake/game.dll +++ b/cart/snake/game.dll Binary files differ diff --git a/cart/test/game.dll b/cart/test/game.dll new file mode 100644 index 0000000..6b98548 --- /dev/null +++ b/cart/test/game.dll Binary files differ diff --git a/cart/test/player.pbm b/cart/test/player.pbm new file mode 100644 index 0000000..a68ece6 --- /dev/null +++ b/cart/test/player.pbm Binary files differ diff --git a/snake/snake.c b/snake/snake.c index 0a2d9d9..71df46b 100755 --- a/snake/snake.c +++ b/snake/snake.c @@ -270,7 +270,7 @@ { if (board[INDEX(x, y)] == BLOCK) { - d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, block, 0, 0, 0, 0, BLACK, WHITE); + d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, block, 0, 0, 0, 0, BLACK, WHITE, R_NONE); } } } @@ -312,7 +312,7 @@ if (yOrder != 0 || fruitFlashTimer > 0) { - d_pbm(x, y, fruit[level_fruit[i]], 0, 0, 0, 0, BLACK, WHITE); + d_pbm(x, y, fruit[level_fruit[i]], 0, 0, 0, 0, BLACK, WHITE, R_NONE); } } @@ -339,7 +339,7 @@ coords(i, &x, &y); printf("Fruit_%d at %d, index %d: %dx%d\n", fruit_type, r, i, x, y); - d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, fruit[fruit_type], 0, 0, 0, 0, BLACK, WHITE); + d_pbm(PAD_X + x * BLOCK_SIZE, PAD_Y + y * BLOCK_SIZE, fruit[fruit_type], 0, 0, 0, 0, BLACK, WHITE, R_NONE); emptyTiles--; diff --git a/test/test.c b/test/test.c new file mode 100644 index 0000000..cffadee --- /dev/null +++ b/test/test.c @@ -0,0 +1,34 @@ +#include +pbm_t* player; +int setup(int a) +{ + player = f_bitmap("/player.pbm"); + return 0; +} + +float x = 0; +float y = 0; +int rot = 0; + +float speed = 80; + + +int loop(int ms) +{ + d_clear(); + if (player) + { + d_pbm((uint16_t)roundf(x), (uint16_t)roundf(y), player, 3, 3, 10, 10, BLACK, WHITE, rot); + } + if (button_pressed(BUTTON_A)) + { + rot = (rot + 1) % 4; + } + + float t = ms / 1000.0f; + if (button_down(DPAD_RIGHT)) x += t * speed; + if (button_down(DPAD_LEFT)) x -= t * speed; + if (button_down(DPAD_DOWN)) y += t * speed; + if (button_down(DPAD_UP)) y -= t * speed; + return 0; +}