#8739 - Snoobab - Fri Jul 18, 2003 9:11 pm
Hi Guys,
I've got a bit of a problem with sprite animation.
In a game I'm busy with I want to playback a explosion animation when a missile hits a enemy. I know of two ways which this can be done, firstly I could load all the animation frames into OAM memory via DMA(which uses a lot of precious OAM memory) and then just change the attritute2 of the sprite to point to the next frame in OAM memory. Or I could just overwrite the animation frame-by-frame(via DMA) which would mean I only have to set aside enough OAM memory for one frame of the animation. Here's my problem: Both methods work but the first method uses a lot of memory (animation frames are 32x32x256 sprites!) and when I use the second method there is a pretty big slowdown while the frame's are being copied/played back via DMA.
Have any of u run into a problem like this before?
Lastly, what is the best way to make a background continually scroll? Here my function is which does it for me:
can it be improved upon?
Hope u can help,
Thanks.
- Ed.[/code]
I've got a bit of a problem with sprite animation.
In a game I'm busy with I want to playback a explosion animation when a missile hits a enemy. I know of two ways which this can be done, firstly I could load all the animation frames into OAM memory via DMA(which uses a lot of precious OAM memory) and then just change the attritute2 of the sprite to point to the next frame in OAM memory. Or I could just overwrite the animation frame-by-frame(via DMA) which would mean I only have to set aside enough OAM memory for one frame of the animation. Here's my problem: Both methods work but the first method uses a lot of memory (animation frames are 32x32x256 sprites!) and when I use the second method there is a pretty big slowdown while the frame's are being copied/played back via DMA.
Have any of u run into a problem like this before?
Lastly, what is the best way to make a background continually scroll? Here my function is which does it for me:
Code: |
void bg_auto_scroll(void) { static u16 BGScroll = 0; WaitForVSync(); REG_BG0HOFS = 100; REG_BG0VOFS = BGScroll; BGScroll --; } |
can it be improved upon?
Hope u can help,
Thanks.
- Ed.[/code]