gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit bf8689ed74ab026b94c651bafb1ef8e0d61dc511 parent bcd716617e8edf64282e6494e601e3cbeb897b34 Author: Toxa <untoxa@mail.ru> Date: Sun, 21 Jan 2024 15:09:01 +0300 EXAMPLES: put sprites to the center of the screen in the multiplayer example Diffstat:
| M | gbdk-lib/examples/cross-platform/multiplayer/src/multiplayer.c | 4 | +++- |
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gbdk-lib/examples/cross-platform/multiplayer/src/multiplayer.c b/gbdk-lib/examples/cross-platform/multiplayer/src/multiplayer.c @@ -14,7 +14,9 @@ void main(void) { set_sprite_data(0, 4, sprite_data); for (uint8_t i = 0; i < 4; i++) { set_sprite_tile(i, i); - move_sprite(i, (i << 3) + 64, 64); + move_sprite(i, + DEVICE_SPRITE_PX_OFFSET_X + (i << 3) + ((DEVICE_SCREEN_PX_WIDTH - (4 * 8)) / 2), + DEVICE_SPRITE_PX_OFFSET_Y + ((DEVICE_SCREEN_PX_HEIGHT - 8) / 2)); } SHOW_SPRITES;
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.