Animating sprites
This demo uses the existing "walk cycle animation" available in the loaded
pattern table to make a sprite animate in place. To achieve this, we do a few
different things:
* To keep track of what cell/frame to animate and where to put the sprite, we
bring in some RAM in the "zero page".
* To organize pattern table references into coherent frames of animations, we
declare an "array" of them called "anim"
* We move the loading of sprite tiles into OAM into a subroutine, making this
the first case of using a subroutine
* We implement a drawing process in the handler for the non-maskable interrupt
(NMI). This not only tells us when it's time to draw but also lets us have
a sense of how much time has elapsed so we can decide when to change frames
of animation.
That's a lot to digest, but the good news is that this is rapidly progressing
towards being an actual animation engine!