Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Stage Script

skellypupper edited this page May 28, 2023 · 15 revisions

Empty Stage Script - Example Stage Script

Stage scripts are used to create stages.

How to use

Make a stage script at assets/stages/<stagenamehere>/init.hxs, you can also put your stage assets in this directory.

Make your sprites and add them via the add function.

Variables

  • stage: The current stage class (an extended FlxTypedGroup). Used to edit your stage.
  • stage.publicSprites: A Map for public sprite variables. Add sprites here if you want to mess with them outside of the stage script.
  • stage.foreground: A FlxTypedGroup that gets added after the rest of the sprites.
  • stage.infrontOfGf: A FlxTypedGroup that gets added in front of girlfriend. (i hate limo so much)
  • Paths: A custom paths instance that only reads for files inside the <stagenamehere> directory.
  • _Paths: The global paths instance.

PlayState variables

  • PlayState.defaultCamZoom: A float value for how zoomed in the camera is on your stage. (default: 1.05)
  • PlayState.curUi: A string value for which ui type (strums, notes and combo) should be used. (Game comes with support for "normal" and "pixel")
  • PlayState.startOn: A dynamic value that allows you to set where the camera begins at on your stage, this can be set to bf, gf, dad or a 2 float value array.
  • PlayState.moveCam(val:Dynamic): Same as above, but it's a function you can call mid-game.

Callbacks

Required

  • create(): This is where you actually create all your stage variables.

Optional

  • createPost(): A function called after bf (PlayState.bf), gf (PlayState.gf) and dad (PlayState.dad) are created, use this function to reposition your characters.
  • stepHit(step:Int): Called every time a step is hit from the PlayState. Good for making background characters bop.
  • beatHit(beat:Int): Called every time a beat is hit from the PlayState.
  • update(elapsed:Float): Called every frame.
Clone this wiki locally