Art, sprites and animation

Play this lesson

A game that looks like a collage

Kai and Remy's first Hyper Shards mixed art from everywhere: a shiny 3D-looking ship, cartoon aliens and tiny pixel shards. Each picture was fine on its own. Together, nothing matched, and the game looked unfinished.

Art is the first thing players judge, often from one screenshot on a store page. Most 2D game art is made of sprites: flat pictures the game moves around as one object, like the ship, an alien or Sprig.

Pixel art or vector?

Quick check

Kai scales a 32 by 32 pixel-art ship up to 96 by 96, and it looks blurry. What is the fix?

  1. Turn off smoothing, so each pixel becomes a sharp 3 by 3 block
  2. Scale it to 100 by 100 instead
  3. Save it as a bigger file
Show the answer

Turn off smoothing, so each pixel becomes a sharp 3 by 3 block

Smoothing blends pixels together, which blurs pixel art. With smoothing off (in CSS, image-rendering: pixelated) and a whole-number scale like 3x, every pixel stays a crisp square.

One style, one palette

A style guide is the studio's rule list for art:

Frames and sprite sheets

Animation is a flipbook. Sprig's walk is 6 still pictures, called frames, shown one after another.

Instead of 6 separate files, the frames sit side by side in one image called a sprite sheet. Every frame is 64 by 64 pixels, so frame 3 starts 3 x 64 = 192 pixels from the left. The game cuts out one rectangle at a time. One file loads and draws faster than six.

Animations usually show 8 to 12 drawings a second, even in a game running at 60 frames a second.

Read the code

sprig.js
// Sprig walks: 6 frames, 64 x 64 pixels eachconst FRAMES = 6;const ANIM_FPS = 10; // drawings per secondfunction walkFrame(time) { // time in seconds  return Math.floor(time * ANIM_FPS) % FRAMES;}// cut out: x = walkFrame(t) * 64, y = 0

Frames are numbered 0 to 5. Which frame does Sprig show at 1.25 seconds?

  1. Frame 0
  2. Frame 2
  3. Frame 5
  4. Frame 12
Show the answer

Frame 0

1.25 x 10 = 12.5, and Math.floor rounds down to 12. The % sign gives the remainder after dividing by 6, and 12 / 6 leaves 0, so the walk has looped twice and is back on frame 0. Using time, not frame counts, keeps the walk the same speed on every screen.

Keep images small

A picture has two sizes. The file size is what players download. The memory size is what it takes once the game opens it: every pixel is unpacked to 4 bytes (red, green, blue and transparency).

So a 2,048 by 2,048 picture uses about 16 MB of memory, even if the PNG file is small. Phones run out of memory fast, and then games stutter or crash.

The rule: make sprites the size they are shown. A ship shown at 64 pixels does not need a 1,024-pixel drawing.

Prompting Nano Banana 2

The studio's image tool is Nano Banana 2, Google's AI image model. We use it for concept art and sprite ideas. A good prompt names:

Prompt pick

Remy needs a new alien sprite idea for Hyper Shards. Which prompt is best?

  1. Cool alien spaceship, make it awesome
  2. Pixel art alien ship seen from directly above, round body, three glowing eyes, red and orange palette, thick dark outline, transparent background
  3. A realistic photo of a huge alien mothership over a city at sunset
Show the answer

Pixel art alien ship seen from directly above, round body, three glowing eyes, red and orange palette, thick dark outline, transparent background

The second prompt names the subject, style, palette, view angle and background, which matches a top-down shooter. The first gives the AI almost nothing, and the third is a photo-style scene that would clash with the game.

Consistent, cleaned up and allowed

Bolt says: Next lesson: the asset pipeline, the path every picture and sound takes from the artist to the game.

Fact-checked 9 October 2026