Stage Group

From LuaSTG Wiki
Jump to navigation Jump to search

A stage group node defines a stage group. A stage group is a collection of stages, and is usually used to implement different difficulties of a game.


Stage Group[edit | edit source]

In LuaSTG, a stage group consists of one or several stages. When the player enters the stage group, the stages will be played one by one in the order they are arranged under the stage group node in the editor. Stage groups can be used to implement the difficulties of a game, where the stage groups contain the same stages, with some parameters differ in each stage group to adjust the difficulty of the game.


Parameters[edit | edit source]

Here is a list of parameters of stage group node.

Parameters Function
Name (string without quotations) Name of the stage group. E.g. Easy, Lunatic, AStageGroup
Start life (number) Starting number of lives a player has when the stage group is entered
Start power (number) Starting power of the player. The unit is in one-hundredth. For example, if 300 is entered here, the player will have 3.00P at start
Start faith (number) Starting number of faith. Faith is the multiplier on the score obtained by the player through collecting point items
Start bomb (number) Starting number of bombs a player has
Allow practice (boolean) Allows the stage group to show up in stage group selection menu in practice mode
Difficulty value (number)

By default, the value entered in the Name parameter will be used in stage group selection menu in the game, as a simple way to identify a stage group from other groups in the game. In the gameplay, the upper-right corner will display a difficulty indicator according to the Name you entered, which is some text that displays what stage group you are currently playing. If Name is set to one of Easy, Normal, Hard, Extra or Lunatic, then "Thlib\UI\rank.png" will be used as difficulty indicator (instead of text) by default.

For Start power, in some versions of LuaSTG the default power is 0 when the minimum power player can have is 1.00P, causing some glitches.


Entering a Stage Group[edit | edit source]

To enter a stage group defined in a script, run the script first. As the game opens, the default menu of LuaSTG should pop up. Select Start Game, then a menu titled Select Difficulty should appear, and that's where you can select a stage group in the game to play on.


Example[edit | edit source]

In this example, we will create a small stage group with two simple stages.

Stage Group Example 1.png

We create an empty stage group node, add two stages under it and set its Name to "Test". In the first stage, we set the background to temple and shoot a red bullet; in the second stage, we set the background to starlight and shoot a blue bullet. After entering the stage group in the game, we go through the first stage, and then the second group, as expected.

Note in the above image I used the default spawn position self.x and self.y as the spawn point of the bullets, even though self is not a boss or enemy at this point. This is because self.x and self.y are set to 0 in the stage portion for convenience. More precisely, stages are implemented as LuaSTG objects as well, self references the stage object inside a stage node, and the .x and .y attributes of a stage are 0 by default.