Skip to main content
The stage system manages the visual environment, background props, character positioning, and camera behavior during gameplay.

Stage Architecture

Stage Class

Stages are groups of props rendered in PlayState:
Key Properties:
String
Display name of the stage
Float
default:"1.0"
Default camera zoom level for this stage
Map<String, StageProp>
Props that can be referenced by name in scripts

Stage Data Format

Stage data is stored in JSON files at assets/data/stages/[id].json:

Stage Data Fields

String
required
Stage data format version (currently “1.0.0”)
String
required
Display name for the stage
Float
default:"1.0"
Default camera zoom level
String
default:"shared"
Asset directory for stage props (for modding support)
Array<StageDataProp>
required
Array of prop definitions (see below)
StageDataCharacters
required
Position and settings for bf, dad, and gf

Stage Props

Props are the visual elements that make up a stage.

Prop Data Structure

Basic Prop

Simple static image:

Solid Color Prop

Create colored rectangles:
When assetPath starts with #, it’s treated as a color code, and scale defines the rectangle size.

Animated Props

Props with animations:

Bopping Props

Props that bop to the music:
Set danceEvery to the number of beats between bops (e.g., 1 = every beat, 2 = every other beat).

Z-Index System

The zIndex determines render order: Typical z-index ranges:
  • Background layers: -1000 to 0
  • Mid-ground props: 0 to 500
  • Front-ground props: 500 to 999
  • Girlfriend: 900
  • Boyfriend/Dad: 1000
  • Foreground overlays: 1001+
Props and characters are automatically sorted by z-index during stage construction.

Parallax Scrolling

The scroll property creates depth through parallax:
Scroll factor values:
  • [1.0, 1.0]: Moves 1:1 with camera (foreground)
  • [0.5, 0.5]: Moves half as much (mid-ground)
  • [0.0, 0.0]: Static, doesn’t move (UI elements)
  • [2.0, 2.0]: Moves twice as much (rare, special effects)
Example layers:

Character Positioning

Stages define where characters stand:

Character Data Fields

Array<Float>
required
Character position as [x, y] (at character’s feet)
Int
default:"1000"
Render order relative to props
Float
default:"1.0"
Scale multiplier applied to character (in addition to character’s base scale)
Array<Float>
default:"[0, 0]"
Camera focus offset as [x, y] when focusing on this character

Camera System

Camera Zoom

The stage defines a default camera zoom:
This is applied when the stage loads and can be dynamically changed during gameplay.

Camera Focus Points

The camera focuses on character positions:
When a character sings, the camera moves to their cameraFocusPoint:
Camera offsets shift focus:
  • Boyfriend: [-100, -100] (left and up)
  • Dad: [100, -100] (right and up)
  • Girlfriend: [0, 0] (centered)

Camera Events

Stages can respond to camera events via scripts:

Stage Props API

Accessing Props

Named props can be accessed in scripts:

Prop Animation

Animate props dynamically:

Adding Props at Runtime

Stage Lighting

Stages can implement lighting effects:

Pixel Art Stages

For pixel-art stages, disable anti-aliasing:
Pixel art best practices:
  • Set isPixel: true on all props
  • Use integer scale factors (6 is common)
  • Save sprites at native resolution, scale up in-engine
  • Ensure characters also have isPixel: true

Stage Scripts

Create custom stage behavior with scripts: File: assets/data/stages/myStage.hxs

Stage Loading

Stages are loaded via StageRegistry:
The loading process:
  1. Loads JSON data from assets/data/stages/[id].json
  2. Creates Stage instance
  3. Instantiates all props from props array
  4. Loads prop assets and animations
  5. Sorts props by z-index
  6. Positions characters based on characters data
  7. Applies camera zoom
  8. Calls onCreate() event

Example: Complete Stage