What would be the techniques available to flash (make white) a sprite on a hit? (I got the collision in place now).
@sempressimo
I think you might learn more by trying to figure this out yourself. Try to image the sequence of events and what order they come in, and how you might trigger them to happen the way you want it to.
Should you store colors in the RAM or just in ROM? Have a specific array of colors that you can update on collision and another if not collision? You decide.
Or, maybe have a very general buffer for all PPU updates that has a string of numbers, the first 2 define the PPU address (3f 1x) the second how many bytes, then the actual colors to be updated. And, then always go to this PPU update subroutine at the start of every NMI to see if anything needs to go to the PPU.
There are really only 2 ways to make your sprite white:
1: Change all colors in its palette(s) to white. This only works if nothing else in the screen uses the same palette(s) as the sprite.
2: Redraw the sprites using only white from a palette that's always available and contains that color. This is doable if you only need to flash one (or a few) "getting hit" frames, otherwise you'll waste too much space with duplicate graphics.
Since both of these methods have limitations, is much simpler to have the sprites flicker transparent instead, something that many games do.
The actual implementation of the effect should be fairly straightforward. The object A.I. should be able to tell if the object is in a hurt/invulnerable state, and maintain a counter to switch between normal and white/invisible while in that state. With that information, the A.I. should be able to modify which meta sprite the object will use, not draw it at all, or even modify the palette and request that it be updated during vblank (if it isn't every frame, like some people like to do).
I agree with dougeff that it's better that you figure out the specific implementation details yourself. Just keep in mind that everything that game objects do is based on states, and whatever variables are necessary to fully describe those states.