A script that can be tied to a Level, which persists across states. Create a scripted class that extends Level to use this. This allows you to customize how a specific level appears.

Static methods

staticinit(clsName:String, id:String, ?params:Dynamic):ScriptedLevel

Initializes a scripted class instance using the given scripted class name and constructor arguments.

staticlistScriptClasses():Array<String>

Returns a list of all the scripted classes which extend this class.

staticscriptStaticCall(clsName:String, funcName:String):Dynamic

Call a custom static function on a scripted class, by the given name, with the given arguments.

staticscriptStaticGet(clsName:String, fieldName:String):Dynamic

Retrieves a custom static variable on a scripted class, by the given name.

@:value({ fieldValue : null })staticscriptStaticSet(clsName:String, fieldName:String, ?fieldValue:Dynamic):Dynamic

Sets the value of a custom static variable on a scripted class, by the given name.

Constructor

new(id:String, ?params:Dynamic)

Methods

_fetchData(id:String):Null<LevelData>

Polymod HScriptedClass override of _fetchData.

buildBackground():FlxSprite

Polymod HScriptedClass override of buildBackground.

Build a sprite for the background of the level. Can be overriden by ScriptedLevel. Not used if isBackgroundSimple returns true.

Returns:

The constructed sprite

@:value({ existingProps : null })buildProps(?existingProps:Array<LevelProp>):Array<LevelProp>

Polymod HScriptedClass override of buildProps.

Build the props for display over the colored background.

Parameters:

existingProps

The existing prop sprites, if any.

Returns:

The constructed prop sprites

buildTitleGraphic():FlxSprite

Polymod HScriptedClass override of buildTitleGraphic.

Construct the title graphic for the level.

Returns:

The constructed graphic as a sprite.

destroy():Void

Polymod HScriptedClass override of destroy.

getBackgroundColor():FlxColor

Polymod HScriptedClass override of getBackgroundColor.

Returns true if the background is a solid color. If you have a ScriptedLevel with a fancy background, you may want to override this to false.

Returns:

The background as a simple color. May not be valid if isBackgroundSimple returns false.

getDifficulties():Array<String>

Polymod HScriptedClass override of getDifficulties.

The list of difficulties the player can select from for this level.

Returns:

The difficulty IDs.

getSongDisplayNames(difficulty:String):Array<String>

Polymod HScriptedClass override of getSongDisplayNames.

Get the list of songs in this level, as an array of names, for display on the menu.

Parameters:

difficulty

The difficulty of the level being displayed

Returns:

The display names of the songs in this level

getSongs():Array<String>

Polymod HScriptedClass override of getSongs.

Get the list of songs in this level, as an array of IDs.

Returns:

Array

getTitle():String

Polymod HScriptedClass override of getTitle.

Retrieve the title of the level for display on the menu.

Returns:

Title of the level as a string

isBackgroundSimple():Bool

Polymod HScriptedClass override of isBackgroundSimple.

Returns true if the background is a solid color. If you have a ScriptedLevel with a fancy background, you may want to override this to false.

Returns:

Whether the background is a simple color

isUnlocked():Bool

Polymod HScriptedClass override of isUnlocked.

Whether this level is unlocked. If not, it will be greyed out on the menu and have a lock icon. Override this in a script.

Returns:

Whether this level is unlocked

isVisible():Bool

Polymod HScriptedClass override of isVisible.

Whether this level is visible. If not, it will not be shown on the menu at all. Override this in a script.

Returns:

Whether this level is visible in the menu

@:value({ funcArgs : null })scriptCall(funcName:String, ?funcArgs:Array<Dynamic>):Dynamic

Calls a function of the scripted class with the given name and arguments.

scriptGet(varName:String):Dynamic

Retrieves the value of a local variable of a scripted class.

@:value({ varValue : null })scriptSet(varName:String, ?varValue:Dynamic):Dynamic

Directly modifies the value of a local variable of a scripted class.

Inherited Variables

Defined by Level

final_data:Null<LevelData>

finalid:String

Inherited Methods