Make a pixel art hit flash

What a hit flash is
When something is hit in a game, it flashes. The character is repainted in a single bright colour for a moment, and then goes back. It is a very old trick and it still works, because it tells the player at once, with no sound and no text, that something landed.
It is also the cheapest animation in this set. A hit flash needs no new drawing at all. The flash frames are the normal frame with every colour replaced. If you can draw a character once, you can flash it.
Open the slime in the editor to try it. It has three frames: the slime as drawn, a white copy and a red copy. The slime is the only frame that was drawn by hand. The other two were made in the editor with the method below.
Make the flash frames
The Bucket has two modes. The usual one fills the connected pixels of one colour. The other, All, fills every pixel of that colour on the frame, wherever it is. That is the one for a flash: tap a colour once and it changes everywhere.
- Press D on the normal frame. A copy appears after it and becomes the current frame.
- Choose the Bucket (press G, or the Bucket in the toolbar). Tap it again if its options are not showing, and choose All. Its label reads "All, fill every pixel of this colour".
- Pick white in the palette.
- Tap each colour of the slime once. The bright green body, the darker green base and the black pupils: three taps. The highlights are already white. When the last colour goes, the slime is a white silhouette.
- Press D on the white frame, pick red, and tap the silhouette once. Every pixel of it is white, so one tap turns the whole thing red.

Each tap is one step, and Undo (Ctrl+Z) takes it back, so you can try a different colour for the flash with no risk.
The three frames
- Normal (300 ms). The slime as drawn: a bright green body, a darker green base, two white highlights and two eyes with black pupils.
- White (70 ms). The same shape in pure white, with no eyes. A silhouette that is as bright as the sprite can get.
- Red (70 ms). The same shape in red. Red is the damage colour, and it lets the flash fade out instead of ending on a blink.
The loop then goes back to the normal frame. So the sequence is a long rest, a white flash, a red flash, and the rest again. In a game, you would play the two flash frames once, when the hit lands, and stay on the normal frame the rest of the time.

Set the timing
A flash only works if it is quick. Longer than about a tenth of a second and it looks like a colour change, not a flash. Here each flash frame is 70 ms, so the whole flash is 140 ms and the loop is 440 ms. The normal frame is held at 300 ms so the slime reads before it flashes again.
A duplicate keeps the time of the frame it came from, so set the times once the frames are made. Use the Duration box beside the timeline for each one (on a phone, Expand timeline, then Frame actions, then Set duration). The editor accepts 10 to 65535 ms, and 70 is a multiple of the 10 ms step a GIF stores, so it comes out as set.
Export the GIF
Press Ctrl+E, choose GIF and press Export GIF. The GIF plays the three frames and loops, so you see the slime get hit again and again, which is useful for a post but not what a game does. For a game, export the frames as a sprite sheet with the JSON (see the sprite sheet guide) and play the flash frames from code, once.
If you tag frames 2 and 3 as "hit", an engine can find them by name. The Godot guide shows how tags become animations.
Tips
- Layers. The Bucket works on the layer you are on, so a character drawn on several layers needs one pass per layer.
- White is not the only flash. Red is for damage, yellow for a pickup, and light blue for freezing. Make the frames and keep the one that reads best.
- Add a knock-back. Move the white frame one pixel away from the hit. A shake and a flash together read as a harder hit.
- Keep a copy of the normal frame. Frame 1 stays as drawn, so you can always redo the flash if you change the character.
For a character that moves, the jump guide is a good next page.