Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hi!
I am making a double dragon game, using GBDK's png2asset to convert the characters sprites into tile data
The sprites are like so :
Some meta sprites like walking animation are 16x32 tiles, some like the jump-kick and punch meta sprite are 32x32
How can I use png2asset to handle multiple sized metasprite.
I think I could group meta sprite by size into multiple .png like linda.png and linda_extended.png and switch sprite data accordingly when the player jump or punch ?
Or maybe, arranging every sprites in a 32x32 grid ?
Does this seems to be a good solution ? I would like to keep using png2asset even for multiple sized sprite, how you guys would handle this problem ?
thanks
Offline
Yes, try using a 32x32 grid. png2asset will only assign sprites for the parts of the 32x32 area which have non-background pixels.
Note: right now png2asset only checks for duplicate regions (aka reducing sprite VRAM pattern data used) on a 8x8 or 8x16 grid (maybe better in the future).
Offline
Edit: I figured it out using the metasprite example, https://github.com/gbdk-2020/gbdk-2020/ … asprites.c
if (hide) hide_metasprite(sprite_metasprites[idx], SPR_NUM_START); else hiwater = move_metasprite(sprite_metasprites[idx], TILE_NUM_START, SPR_NUM_START, (PosX >> 4), (PosY >> 4)); // Hide rest of the hardware sprites, because amount of sprites differ between animation frames. hide_sprites_range(hiwater, MAX_HARDWARE_SPRITES);
Thanks for your advice, I change the sprite sheet to have 32x32 sprites
I build the asset using -w32 -h32
This is working fine, except for a sprite "artefact' on screen, after a jump there is a part of the jump kick sprite that stay on screen
https://drive.google.com/file/d/1rO6HC_ … sp=sharing
Any idea what could cause this ? this occurs when display a 16x32 sprite then a 32x32 sprite
main.c source: https://github.com/odrevet/game-boy-gam … src/main.c
Last edited by drev (2022-11-07 00:40:15)
Offline
look into the gbdk-2020/examples/cross-platform/metasprites/ example: elephant animation states consist of different amount of hardware sprites. you need to calculate the "hiwater" value of all rendered metasprites and then use hide_sprites_range() function to hide the rest.
Offline