Module LevelCommon
Level specific functions and classes
-
Level.toggleSwitch (switchID)
-
Toggle state of switch blocks group of given index
Parameters:
- switchID
int
Index of switch group, defined in the config pack
-
Level.getSwitchState (switchID)
-
Get current state of switch blocks group of given index
Parameters:
- switchID
int
Index of switch group, defined in the config pack
Returns:
bool
true or false state
-
Level.triggerEvent (Name)
-
Execute an event program of current level file
Parameters:
- Name
string
of event program to execute
-
Level.shakeScreen (forceX, forceY, decX, decY)
-
Set screen shaking effect (or turn it off by giving of zero force)
Parameters:
- forceX
double
Horizontal shake force (pixels offset at initial position)
- forceY
double
Vertical shake force (pixels offset at initial position)
- decX
double
Deceleration of horizontal shake force per millisecond. Zero value means keeping a shake effect forever
- decY
double
Deceleration of vertical shake force per millisecond. Zero value means keeping a shake effect forever
-
Level.shakeScreenX (forceX, decX)
-
Set screen shaking effect for horizontal dimension (or turn it off by giving of zero force)
Parameters:
- forceX
double
Horizontal shake force (pixels offset at initial position)
- decX
double
Deceleration of horizontal shake force per millisecond. Zero value means keeping a shake effect forever
-
Level.shakeScreenY (forceY, decY)
-
Set screen shaking effect for vertical dimension (or turn it off by giving of zero force)
Parameters:
- forceY
double
Vertical shake force (pixels offset at initial position)
- decY
double
Deceleration of vertical shake force per millisecond. Zero value means keeping a shake effect forever
-
BGO.count ()
-
Count total BGOs on the level
Returns:
ulong Total count of BGO
-
BGO.get ()
-
Get array of all BGOs are on the level
Returns:
table Array of LevelBGOClass.BaseBGO references
-
Block.count ()
-
Count total Blocks on the level
Returns:
ulong Total count of blocks
-
Block.get ()
-
Get array of all Blocks are on the level
Returns:
table Array of LevelBlockClass.BaseBlock references
-
NPC.count ()
-
Count total NPCs on the level
Returns:
ulong Total count of NPCs
-
NPC.get ()
-
Get array of all NPCs are on the level
Returns:
table Array of LevelNpcClass.BaseNPC references
-
NPC.getActive ()
-
Get array of all activated NPCs (aka all awake NPCs)
Returns:
table Array of LevelNpcClass.BaseNPC references
-
Player.count ()
-
Count total Playable Characters on the level
Returns:
ulong Total count of Playalbe Characters
-
Player.get ()
-
Get array of all Playalbe Characters are on the level
Returns:
table Array of LevelPlayerClass.BasePlayer references
Player Camera cababilities (Level-Only)
-
LevelCamera.x
-
In-Scene X position of camera
-
LevelCamera.y
-
In-Scene Y position of camera
-
LevelCamera.renderX
-
X screen position of camera
-
LevelCamera.renderY
-
Y screen position of camera
-
LevelCamera.centerX
-
Center X screen position of camera
-
LevelCamera.centerY
-
Center Y screen position of camera
-
LevelCamera.width
-
Width of camera
-
LevelCamera.height
-
Height of camera
Playable character state information (Level only)
-
LevelPlayerState.points
-
Points counter (Read Only)
-
LevelPlayerState.coins
-
Coins counter (Read Only)
-
LevelPlayerState.lives
-
Lives/Attempts counter (Read Only)
-
LevelPlayerState.attempts
-
Lives/Attempts counter, alias to lives (Read Only)
-
LevelPlayerState.leeks
-
Count of stars/leeks (Read Only)
-
LevelPlayerState.stars
-
Count of stars/leeks, alias to leeks (Read Only)
-
LevelPlayerState.health
-
Health level of player (Read Only)
-
LevelPlayerState.characterID
-
ID of playable character (Read Only)
-
LevelPlayerState.stateID
-
ID of playable character's state/suit/form/shape (Read Only)
-
LevelPlayerState:addPoints (points)
-
Add points to player
Parameters:
- points
uint
Count of points to append
-
LevelPlayerState:addCoins (cois)
-
Add cois to player
Parameters:
- cois
uint
Count of cois to append
-
LevelPlayerState:addLeeks (leeks)
-
Add leeks/stars to player
Parameters:
- leeks
uint
Count of leeks to append
-
LevelPlayerState:addStars (stars)
-
Add leeks/stars to player, alias to addLeeks
Parameters:
- stars
uint
Count of Stars to append
-
LevelPlayerState:addLives (lives)
-
Add or removes lives of player
Parameters:
- lives
int
Count of lives to add (positive) or remove (negative)
-
LevelPlayerState:addAttempts (attempts)
-
Add or removes attempts of player, alias to addLives
Parameters:
- attempts
int
Count of attempts to add (positive) or remove (negative)
-
LevelPlayerState:setPoints (points)
-
Set absolute value of points
Parameters:
- points
uint
Count of points to set
-
LevelPlayerState:setCoins (points)
-
Set absolute value of coins
Parameters:
- points
uint
Count of coins to set
-
LevelPlayerState:setLeeks (points)
-
Set absolute value of leeks
Parameters:
- points
uint
Count of leeks to set
-
LevelPlayerState:setStars (points)
-
Set absolute value of stars, alias to setLeeks
Parameters:
- points
uint
Count of stars to set
-
LevelPlayerState:setLives (points)
-
Set absolute value of lives
Parameters:
- points
uint
Count of lives to set
-
LevelPlayerState:setAttempts (points)
-
Set absolute value of attempts, alias to setLives
Parameters:
- points
uint
Count of attempts to set
-
LevelPlayerState.playerID
-
ID of player (Read Only)