#80213 - aik6980 - Thu Apr 20, 2006 1:31 am
Hi,
I begun to build my first platform game in last 2 months. I've got some questions, hope you guy can help
1. i've done my BiltBackground function, it work and fast enough but how can i make it faster using DMA?
2. Here's my code for CollisionTest. I found the problem when I try to make Y-axis scrolling down (yes, only when my character 's falling) :)
. It seem like they cannot detect my ground tile (because it will scroll away when my character y position is not in the screen center yet)
3. how could i scroll in both x, y direction and blit below 1 tile/frame. You can see my BlitBG it will adjust the offset at least by 1 tile, however i want to make it move more smoother.
4. some kind of stupid question. where can i post my game here? i'm looking for some comment for my further development.
thank you very much!!!
I begun to build my first platform game in last 2 months. I've got some questions, hope you guy can help
1. i've done my BiltBackground function, it work and fast enough but how can i make it faster using DMA?
Code: |
void BlitBG(CStage *st){ int x=0,y=0; for(y=0;y<32;y++){ for(x=0;x<32;x++) st->bg[0].mapData[x+y*32]=bgMap0[x+st->_xOffset+y*(st->_Width)]; } } |
2. Here's my code for CollisionTest. I found the problem when I try to make Y-axis scrolling down (yes, only when my character 's falling) :)
. It seem like they cannot detect my ground tile (because it will scroll away when my character y position is not in the screen center yet)
Code: |
// collision test between player and map Y(ground) u8 collisionTest_PVMy(CStage *st, CSprite *obj){ int loop=0; int tx=0,ty=0; int tw=obj->tileWidth; int th=obj->tileHeight; tx=((obj->px)>>3)+st->_xOffset; ty=((obj->py)>>3)+(th)+st->_yOffset; //add offset from the stage to match the collision array position while(loop<tw){ if(bgCollision[((tx+loop)+(ty)*(st->_Width))]==0x0004){ return HITDOWN; } loop++; } return OK; } |
3. how could i scroll in both x, y direction and blit below 1 tile/frame. You can see my BlitBG it will adjust the offset at least by 1 tile, however i want to make it move more smoother.
4. some kind of stupid question. where can i post my game here? i'm looking for some comment for my further development.
thank you very much!!!