Constructor
new Stage(md, stage_id)
Creates an instance of Stage.
Parameters:
Name | Type | Description |
---|---|---|
md |
number | Type of constructor to use 0:Random generated Stage |
stage_id |
number | ID of stage to load |
- Source:
Members
complete :boolean
Completed flag
Type:
- boolean
- Source:
planets :Array
Main array of GameObject storage. Size is number of Planet plus an addition slot for the player
Type:
- Array
- Source:
- To Do:
-
- Add additional slots for procedurals
score :number
Amount of points available
Type:
- number
- Source:
skybox :array
Array of StarObject to render in 3d mode
Type:
- array
- Source:
skymat :array
Array of StarObject to render in 2d mode
Type:
- array
- Source:
Methods
generate()
Generates a new, random, valid and stable stage
- Source:
- To Do:
-
- add procedurals
generate_skybox(num, project) → {array}
Generates a new skybox
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Number of stars to create |
project |
boolean | If stars should be projected to the boundries |
- Source:
Returns:
skybox array
- Type
- array
load(stage_id)
Loads a stage from file
Parameters:
Name | Type | Description |
---|---|---|
stage_id |
ID of stage to load |
- Source:
reload()
Resets stage to defaults
- Source: