can we have two different 32*32 bitmaps(two players) in spritegame? | developer.brewmp.com can we have two different 32*32 bitmaps(two players) in spritegame? | developer.brewmp.com

Developer

can we have two different 32*32 bitmaps(two players) in spritegame?

Forums:

hi all
is it possible to load two bitmap of same size say 32*32 ? as in spritegame the player is of 32*32 size & its bmp is sprites32.bmp. can i add one more sprites1_32.bmp to this code & draw the another player. how brew recognize which image to draw? hope u understand
thanks in advanece....

can we use more than one 16*16 bmp to draw background in spritegame ?
in spritegame example only one bg16.bmp is used. which is used to draw the bg.
if i use another bmp of 16*16 size to add some tiles to bground then it doesent work the tile from second image is drawn. the code i have used is
CHECK_NULL(pbmDib = ISHELL_LoadBitmap(pMe->a.m_pIShell, "bg16.bmp"));
CHECK_ERROR(IBITMAP_GetInfo(pbmDib, &bi, sizeof(bi)));
CHECK_ERROR(IBITMAP_CreateCompatibleBitmap(pbmScreen, &pbmDdb, (uint16)bi.cx, (uint16)bi.cy));
CHECK_ERROR(IBITMAP_BltIn(pbmDdb, 0, 0, (uint16)bi.cx, (uint16)bi.cy, pbmDib, 0, 0, AEE_RO_COPY));
IBITMAP_Release(pbmDib);
pbmDib = NULL;
CHECK_ERROR(IBITMAP_GetPixel(pbmDdb, 0, 0, &color));
CHECK_ERROR(IBITMAP_SetTransparencyColor(pbmDdb, color));
CHECK_ERROR(ISPRITE_SetTileBuffer(pMe->pISprite, TILE_SIZE_16X16, pbmDdb));
CHECK_ERROR(ISPRITE_SetSpriteBuffer(pMe->pISprite, SPRITE_SIZE_16X16, pbmDdb));
IBITMAP_Release(pbmDdb);
pbmDdb = NULL;
CHECK_NULL(pbmDib = ISHELL_LoadBitmap(pMe->a.m_pIShell, "tiles1.bmp"));
CHECK_ERROR(IBITMAP_GetInfo(pbmDib, &bi, sizeof(bi)));
CHECK_ERROR(IBITMAP_CreateCompatibleBitmap(pbmScreen, &pbmDdb, (uint16)bi.cx, (uint16)bi.cy));
CHECK_ERROR(IBITMAP_BltIn(pbmDdb, 0, 0, (uint16)bi.cx, (uint16)bi.cy, pbmDib, 0, 0, AEE_RO_COPY));
IBITMAP_Release(pbmDib);
pbmDib = NULL;
CHECK_ERROR(IBITMAP_GetPixel(pbmDdb, 0, 0, &color));
CHECK_ERROR(IBITMAP_SetTransparencyColor(pbmDdb, color));
CHECK_ERROR(ISPRITE_SetTileBuffer(pMe->pISprite, TILE_SIZE_16X16, pbmDdb));
CHECK_ERROR(ISPRITE_SetSpriteBuffer(pMe->pISprite, SPRITE_SIZE_16X16, pbmDdb));
IBITMAP_Release(pbmDdb);
pbmDdb = NULL;
after executing ,this snippet draw tiles from tiles1.bmp what if i want to use images from bg16.bmp?how can i fix this problem pls help.
waiting for reply.........

can we use more than one 16*16 bmp to draw background in spritegame ?
in spritegame example only one bg16.bmp is used. which is used to draw the bg.
if i use another bmp of 16*16 size to add some tiles to bground then it doesent work the tile from second image is drawn. the code i have used is
CHECK_NULL(pbmDib = ISHELL_LoadBitmap(pMe->a.m_pIShell, "bg16.bmp"));
CHECK_ERROR(IBITMAP_GetInfo(pbmDib, &bi, sizeof(bi)));
CHECK_ERROR(IBITMAP_CreateCompatibleBitmap(pbmScreen, &pbmDdb, (uint16)bi.cx, (uint16)bi.cy));
CHECK_ERROR(IBITMAP_BltIn(pbmDdb, 0, 0, (uint16)bi.cx, (uint16)bi.cy, pbmDib, 0, 0, AEE_RO_COPY));
IBITMAP_Release(pbmDib);
pbmDib = NULL;
CHECK_ERROR(IBITMAP_GetPixel(pbmDdb, 0, 0, &color));
CHECK_ERROR(IBITMAP_SetTransparencyColor(pbmDdb, color));
CHECK_ERROR(ISPRITE_SetTileBuffer(pMe->pISprite, TILE_SIZE_16X16, pbmDdb));
CHECK_ERROR(ISPRITE_SetSpriteBuffer(pMe->pISprite, SPRITE_SIZE_16X16, pbmDdb));
IBITMAP_Release(pbmDdb);
pbmDdb = NULL;
CHECK_NULL(pbmDib = ISHELL_LoadBitmap(pMe->a.m_pIShell, "tiles1.bmp"));
CHECK_ERROR(IBITMAP_GetInfo(pbmDib, &bi, sizeof(bi)));
CHECK_ERROR(IBITMAP_CreateCompatibleBitmap(pbmScreen, &pbmDdb, (uint16)bi.cx, (uint16)bi.cy));
CHECK_ERROR(IBITMAP_BltIn(pbmDdb, 0, 0, (uint16)bi.cx, (uint16)bi.cy, pbmDib, 0, 0, AEE_RO_COPY));
IBITMAP_Release(pbmDib);
pbmDib = NULL;
CHECK_ERROR(IBITMAP_GetPixel(pbmDdb, 0, 0, &color));
CHECK_ERROR(IBITMAP_SetTransparencyColor(pbmDdb, color));
CHECK_ERROR(ISPRITE_SetTileBuffer(pMe->pISprite, TILE_SIZE_16X16, pbmDdb));
CHECK_ERROR(ISPRITE_SetSpriteBuffer(pMe->pISprite, SPRITE_SIZE_16X16, pbmDdb));
IBITMAP_Release(pbmDdb);
pbmDdb = NULL;
after executing ,this snippet draw tiles from tiles1.bmp what if i want to use images from bg16.bmp?how can i fix this problem pls help.
waiting for reply.........

pls help its urgent........
ketan

pls help its urgent........
ketan

In ISPRITE_DrawTiles there is some concept of Layers. Check up on that may be that will help..

In ISPRITE_DrawTiles there is some concept of Layers. Check up on that may be that will help..

Thanks ash
see i knw that concept. i want to draw the bground using tile engine. In spritegame they have arranged all the tiles in one bmp ie bg16.bmp. each tile is of 16*16 & using these tiles they formed the background for spritegame. (montain & base tiles for player). now my game consist of several chapters(levels).each level has different background so i have to load more than one bmp of tilesize 16*16. but what happened is whenever i load the second bmp of 16*16 the brew buffers that second bmp & tiles from I st bmp disappered.
did u knw how to load more than one bmp of same size(16*16)?
tanks in advance

Thanks ash
see i knw that concept. i want to draw the bground using tile engine. In spritegame they have arranged all the tiles in one bmp ie bg16.bmp. each tile is of 16*16 & using these tiles they formed the background for spritegame. (montain & base tiles for player). now my game consist of several chapters(levels).each level has different background so i have to load more than one bmp of tilesize 16*16. but what happened is whenever i load the second bmp of 16*16 the brew buffers that second bmp & tiles from I st bmp disappered.
did u knw how to load more than one bmp of same size(16*16)?
tanks in advance

pls help its urgent

pls help its urgent

Are you talking about overlapping bitmaps ?
You could probably update only a part of the display or if you are overlapping the bitmaps then use the alpha blending(transparency) in the bitmap..
Probably IDisplay_SetClipRect() could help ?

Are you talking about overlapping bitmaps ?
You could probably update only a part of the display or if you are overlapping the bitmaps then use the alpha blending(transparency) in the bitmap..
Probably IDisplay_SetClipRect() could help ?