Stage

From LuaSTG Wiki
Jump to navigation Jump to search

A stage node defines a stage in LuaSTG.


Stage[edit | edit source]

In LuaSTG, a stage is a level in the game. A stage has to belong to a Stage Group, specifically the node where the stage node is put under as a child node. Two stages having the same name under different stage groups are different stages. For example, "stage 1" under stage group "Easy" is not the same LuaSTG stage as "stage 1" under stage group "Normal".

A stage usually consists of backgrounds, music, enemies and boss fights.

Despite its functionality in the game, stages are implemented as LuaSTG objects as well, meaning that they are Lua lists and they have attributes .x, .y etc.


Entering a Stage[edit | edit source]

There are typically two ways to enter a stage: from Start Game or from Stage Practice. In Start Game, we would need to play through all previous stages to reach a stage, see Stage Group for more details. From practice mode, we can directly play a stage without having to complete all previous stages.

To enter a stage from practice mode, run the script and select Stage Practice. After that, choose the stage group ("difficulty") that this stage belongs to, and select the stage you want to enter. The stage should start by then.


Parameters[edit | edit source]

A list of the parameters of a stage node is shown below.

Parameters Function
Name (string without quotations) Name of the stage. E.g. stage 1
Start life (number) Starting number of lives a player has when the stage is entered in practice mode
Start power (number) Practice mode starting power of the player. The unit is in one-hundredth
Start faith (number) Practice mode starting faith of the player. Faith is the multiplier on the score obtained by the player through collecting point items
Start bomb (number) Practice mode starting number of bombs of the player
Allow practice (boolean) Allows the stage to show up in the stage selection menu in practice mode

By default, the value entered in the Name parameter will be used in stage selection menu in practice mode.


Example[edit | edit source]

We show an example of how to define a stage. We assume we have defined a boss named "testBoss" in advance with Define Boss node, since the content of the boss fight is not important for this example.

Stage Example 1.png

Be carefule the Set Rotation parameter of the Set Velocity node should be set to false, otherwise the fairies will look like they are lying down to one side.

We have created a stage named "Stage 1" with some enemies and a boss fight.

After entering the stage, we see two waves of fairies that spawn and move downward, followed by the appearance of a boss.