#21939 - tornadokick - Wed Jun 09, 2004 10:04 pm
Code: |
void AnimateBG(Bg *bg) // swaps out the tiles to create animation to simulate the waves of water.
{ u16 loop; u16* temp = (u16*)frogmap; for(loop = 0; loop < 64*64 ; loop++) { if (bg->mapData[loop] == 0x00) // if it's one wave pattern, switch bg->mapData[loop] = 0x01; else if (bg->mapData[loop] == 0x01) // if it's the other, switch bg->mapData[loop] = 0x00; } } |
Ok, this should be a somewhat basic approach to swapping out the tiles to create the illusion of motion in a background. It works, but the only every other tile is being changed. The remaining (every other) tiles stay static. To illustrate:
101010101010...
101010101010...
101010101010...
101010101010...
...
1's would signify the tiles that change, and 0's would stay the same. I know essentially why the tiles aren't changing (the loop is just looking at every other tile), but I don't know how to fix it.
Once again. Any help is appreciated.
Last edited by tornadokick on Thu Jun 10, 2004 1:58 am; edited 1 time in total