Opus Motion ★ Star on GitHub

Game & sports · pixel-sprite-scene

Pixel sprite scene (state machine)

A native ~160x90 pixel night scene with dithered sky bands, twinkling stars, a pixel moon, stepped mountains and a ground line; a procedural wizard / knight / cat sprite loops idle, charge, cast, recover with palette-stepped particles, a 1 px moon rim light, 10 fps character timing and 1-2 px screen shake on the cast.

A free, MIT-licensed game graphic from the Opus Motion Library — 616 motions for Remotion, React and plain HTML.

Pixel sprite scene (state machine): three frames of the game graphic, start, middle and end
Pixel sprite scene (state machine) — start, middle and end of the 7.3-second motion.

What Pixel sprite scene (state machine) is for

Retro game promos, indie-dev trailers, nostalgic social posts and loading loops. Pass `sprite`, `palette` and `states` to retheme; for a lit-set storytelling look use lit-pixel-sprite instead.

  • pixel
  • pixel art
  • 8-bit
  • retro
  • game
  • sprite
  • wizard
  • knight
  • cat
  • night
  • moon
  • stars
  • state machine
  • magic
  • particles
  • indie
  • trailer
  • loop
  • dither

Details

Category
Game & sports graphics
Length
7.3 s (220 frames at 30 fps)
Formats
16:9, 1:1, 9:16
Weight
light
Transparent overlay
no
Seamless loop
no
Text props
—
Colour props
—
Mood
pixel, nature, playful, night
Roles
subject

Use Pixel sprite scene (state machine) in Remotion, React or HTML

Remotion project

terminal
# copy this motion into your Remotion project
node cli/mgl.mjs add pixel-sprite-scene --to ../my-app/src

# render an mp4 (run in the library folder)
node cli/mgl.mjs render pixel-sprite-scene --props '{"sprite":"wizard","customArt":[],"customPalette":{},"states":[{"name":"idle","frames":36},{"name":"charge","frames":42},{"name":"cast","frames":20},{"name":"recover","frames":28}]}'

# or export for apps / editors: mp4 | webm-alpha | prores-alpha | gif | png | poster
node cli/mgl.mjs export pixel-sprite-scene --as mp4 --props '{"sprite":"wizard","customArt":[],"customPalette":{},"states":[{"name":"idle","frames":36},{"name":"charge","frames":42},{"name":"cast","frames":20},{"name":"recover","frames":28}]}'

React / Next.js

tsx
import {MotionPlayer} from 'opus-motion-library/web';

<MotionPlayer
  motion="pixel-sprite-scene"
  props={{
    sprite: 'wizard',
    customArt: [],
    customPalette: {},
    states: [
      {name: 'idle', frames: 36},
      {name: 'charge', frames: 42},
      {name: 'cast', frames: 20},
      {name: 'recover', frames: 28},
    ],
  }}
  playOnView
  loop="auto"
/>

Plain HTML / WordPress

html
<script src="opus-motion.element.js" defer></script>

<opus-motion motion="pixel-sprite-scene"
  props='{"sprite":"wizard","customArt":[],"customPalette":{},"states":[{"name":"idle","frames":36},{"name":"charge","frames":42},{"name":"cast","frames":20},{"name":"recover","frames":28}]}'>
</opus-motion>

Compose spec (multi-scene video)

json
{
  "width": 1920,
  "height": 1080,
  "fps": 30,
  "scenes": [
    {
      "motion": "pixel-sprite-scene",
      "props": {
        "sprite": "wizard",
        "customArt": [],
        "customPalette": {},
        "states": [
          {
            "name": "idle",
            "frames": 36
          },
          {
            "name": "charge",
            "frames": 42
          },
          {
            "name": "cast",
            "frames": 20
          },
          {
            "name": "recover",
            "frames": 28
          }
        ]
      }
    }
  ]
}

Pixel sprite scene (state machine) props

12 parameters — change any of them to make the motion yours.

PropDefaultWhat it does
sprite"wizard"'wizard' | 'knight' | 'cat' | 'custom' (customArt + customPalette)
customArt[]rows of characters for a custom sprite, e.g. ["..oo..","ohhho."] (.=transparent)
customPalette{}map char -> hex colour for customArt
states[{"name":"idle","frames":36},{"name":"charge","frames":42},{"name":"cast","frames":20},…[{name:'idle'|'charge'|'cast'|'recover', frames}] looped in order
palette{"sky":["#090C24","#0F1538","#17205A","#25347F","#3B4FA0","#6B79BF"],"star":"#FFF6D6","…scene palette: sky[] bands (top->horizon), star, moon, far/near mountains, ground, hero colours, magic, rim
particles26particle count (0 = none)
pixelFactor12screen px per logical pixel at 1080 (12 = 160x90)
spriteScale2integer scale of the sprite (2 = chunky 2x2 pixels)
animFps10character / particle animation rate (8-12)
shake2screen-shake px on the cast (0-2)
moonSide"right"'left' | 'right' (also the rim-light side)
seed11star / particle seed

Notes & credits

Technique sources:

  • prompt-corpus: pixel-sprite-scene (40 cases)
  • awesome-opus5-5-videos prompts (MIT) — technique only