Sprite Tamer — CSS

Set Pak Harun walking to the market: 12 levels of spritesheets, background-position, @keyframes, steps(), animation-delay and transform.

What the levels ask

  1. The walk sheet has 6 frames in a row, each 32×32. Set the sheet as the background of .hero and make its box exactly 32×32 so only the first frame shows.
  2. Show the 4th frame (index 3). Shift the background left by 3 frames with background-position.
  3. Create @keyframes named jalan (walk) that shifts background-position from 0 to -192px (6 frames), then attach it: animation jalan, duration 0.75s, linear, infinite. Watch the result: the sprite will look smeared. That's on purpose, we fix it in the next level.
  4. Replace linear with steps(6) so the background jumps 6 times per loop, one frame per jump. Now it really walks.
  5. The target walks at a relaxed pace: one loop takes 1.5 seconds. Adjust the duration.
  6. Use the idle sheet (4 frames). Play the pose animation just ONCE (0.5s, steps(4)) and make sure it stops on the last frame instead of going back to the start.
  7. The sheet only has a right-facing version. Without a new image, make the hero walk facing left.
  8. Two sprites with the same animation look stiff when they're in sync. Make .teman (friend) start from HALF a loop (0.5s ÷ 2) with a negative delay.
  9. Add a second animation named naik (rise) on translateY (0 → -3px), 0.4s, ease-in-out, infinite, alternate. The jalan animation must stay.
  10. When the cursor touches .hero, the animation must pause (not disappear). Add a :hover rule.
  11. This sheet stacks 4 frames DOWNWARD (32×128). Create a pose animation 0.5s steps(4) infinite that shifts the background up, not left.
  12. Hero: jalan 0.75s steps(6) infinite, facing left, plus an up-and-down bob 0.4s ease-in-out infinite alternate. Teman: idle pose 0.5s steps(4) infinite with a -0.25s delay. Write it all from scratch.