Trouble Creating Metasprite Animations
Moderator: Moderators
Trouble Creating Metasprite Animations
So I've been working on my own NES project recently (written in ASM6), and I've had some trouble making a working player animation with metasprites. For now, I'm just trying to get an idle animation where the player blinks periodically. I've tried making tables of Animation sequences, which contain the duration of the frame and the location of the metasprite, but nothing I've tried has proven successful, and I feel like my code is getting too confusing for it's own good, prompting me to wonder if I'm even going in the right direction, or if there's a much simpler way to do metasprite animations(probably the latter). I've looked through the wiki and forums, but I haven't been able to find anything suggesting a more effective method. Am I on the right track? Is there a better alternative to what I'm doing? I'd love to know! Attached is the code and chr. for the program. Code concerning player animation starts at lines 246, 416, 441, and 604.
- Attachments
-
- mario.chr
- (8 KiB) Downloaded 119 times
-
- NESGame.asm
- (19.87 KiB) Downloaded 135 times
Re: Trouble Creating Metasprite Animations
What isn't working? I think your approach is fine.
Re: Trouble Creating Metasprite Animations
OK that's good to hear.pubby wrote:I think your approach is fine.
I think my main problem is in the UpdatePlayerAnim routine. What I want it to do is to change the PlayerFramePtr to the next frame of animation in the sequence every time that PlayerAnimCounter reaches zero then looping back to the beginning once it reads a frame length of zero, but that's proving to be easier said than done for me. I think the fact that DrawPlayerAnimFrame takes place during the NMI makes it harder to deal with, since the subroutine's already expecting the animation + frame to be loaded in to the two pointers. Is it possible for me to move updating sprites into the main loop, or does it need to be in vblank? Or should I just load an initial "default animation" during reset?
Re: Trouble Creating Metasprite Animations
The sprite / OAM DMA transfer needs to be during vblank. From a buffer. You can fill the buffer any time.Is it possible for me to move updating sprites...from vblank
nesdoug.com -- blog/tutorial on programming for the NES
Re: Trouble Creating Metasprite Animations
Wow, hearing you say that now makes makes me realize how dumb that last question was. Thanks!
EDIT: Just got the idle animation working properly!
EDIT: Just got the idle animation working properly!