#include <gb/gb.h>
#include "files/sprites.c"
#define SPRT1 0
#define SPRT1_MASK1 0
#define SPRT1_MASK2 1
#define SPRT1_POSX 100
#define SPRT1_POSY 100
#define SPRT2 2
#define SPRITESIZE 8
struct sprite16x16
{
UBYTE spriteid_0;
UBYTE spriteid_1;
UBYTE spriteid_2;
UBYTE spriteid_3;
};
struct sprite16x16 sprite2;
void setup_sprite(struct sprite16x16* sprite, UBYTE id1, UBYTE id2, UBYTE id3, UBYTE id4)
{
set_sprite_tile(id1, id1);
set_sprite_tile(id2, id1);
set_sprite_tile(id3, id2);
set_sprite_tile(id4, id3);
sprite->spriteid_0=id1;
sprite->spriteid_1=id2;
sprite->spriteid_2=id3;
sprite->spriteid_3=id3;
}
move_16x16_sprite(struct sprite16x16* sprite)
{
move_sprite(sprite->spriteid_0, 50, 50);
move_sprite(sprite->spriteid_1, 50 + SPRITESIZE, 50);
move_sprite(sprite->spriteid_2, 50, 50 + SPRITESIZE);
move_sprite(sprite->spriteid_3, 50 + SPRITESIZE, 50 + SPRITESIZE);
}
void main()
{
//One 8x8 sprite x two masks = 2
set_sprite_data(SPRT1, 2, sprite1_tiles);
set_sprite_tile(SPRT1, SPRT1_MASK1);
move_sprite(SPRT1, SPRT1_POSX, SPRT1_POSY);
//One 16x16 sprite x 1 mask = 4
set_sprite_data(SPRT2, 4, sprite2_tiles);
setup_sprite(&sprite2, 2, 3, 4, 5);
//Move sprite
move_16x16_sprite(&sprite2);
SHOW_SPRITES;
}