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 Jan 8, 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.hx, you can also put your stage assets in this directory.

Make your sprites and add them via stage.add,

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)

stage.defaultCamZoom: A float value for how zoomed in the camera is on your stage.

stage.cameraDisplace: An XY pair accessible via cameraDisplace.x and cameraDisplace.y that changes where the camera starts at on your stage.

Paths: A custom paths instance that only reads for files inside the <stagenamehere> directory.

_Paths: The global paths instance.

Callbacks

Required

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

Optional

reposCharacters(): A function called after bf (PlayState.boyfriend), 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