Module LevelCommon

Level specific functions and classes

Generic level static functions

Level.toggleSwitch (switchID) Toggle state of switch blocks group of given index
Level.getSwitchState (switchID) Get current state of switch blocks group of given index
Level.triggerEvent (Name) Execute an event program of current level file
Level.shakeScreen (forceX, forceY, decX, decY) Set screen shaking effect (or turn it off by giving of zero force)
Level.shakeScreenX (forceX, decX) Set screen shaking effect for horizontal dimension (or turn it off by giving of zero force)
Level.shakeScreenY (forceY, decY) Set screen shaking effect for vertical dimension (or turn it off by giving of zero force)

BGO static functions

BGO.count () Count total BGOs on the level
BGO.get () Get array of all BGOs are on the level

Blocks static functions

Block.count () Count total Blocks on the level
Block.get () Get array of all Blocks are on the level

NPC static functions

NPC.count () Count total NPCs on the level
NPC.get () Get array of all NPCs are on the level
NPC.getActive () Get array of all activated NPCs (aka all awake NPCs)

Playable Characters static functions

Player.count () Count total Playable Characters on the level
Player.get () Get array of all Playalbe Characters are on the level

Class LevelCamera

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

Class LevelPlayerState

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
LevelPlayerState:addCoins (cois) Add cois to player
LevelPlayerState:addLeeks (leeks) Add leeks/stars to player
LevelPlayerState:addStars (stars) Add leeks/stars to player, alias to addLeeks
LevelPlayerState:addLives (lives) Add or removes lives of player
LevelPlayerState:addAttempts (attempts) Add or removes attempts of player, alias to addLives
LevelPlayerState:setPoints (points) Set absolute value of points
LevelPlayerState:setCoins (points) Set absolute value of coins
LevelPlayerState:setLeeks (points) Set absolute value of leeks
LevelPlayerState:setStars (points) Set absolute value of stars, alias to setLeeks
LevelPlayerState:setLives (points) Set absolute value of lives
LevelPlayerState:setAttempts (points) Set absolute value of attempts, alias to setLives
LevelPlayerState.playerID ID of player (Read Only)


Generic level static functions

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 static functions

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

Blocks static functions

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 static functions

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

Playable Characters static functions

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

Class LevelCamera

Player Camera cababilities (Level-Only)
LevelCamera.x
In-Scene X position of camera
  • x double
LevelCamera.y
In-Scene Y position of camera
  • y double
LevelCamera.renderX
X screen position of camera
  • renderX double
LevelCamera.renderY
Y screen position of camera
  • renderY double
LevelCamera.centerX
Center X screen position of camera
  • centerX double
LevelCamera.centerY
Center Y screen position of camera
  • centerY double
LevelCamera.width
Width of camera
  • width int
LevelCamera.height
Height of camera
  • height int

Class LevelPlayerState

Playable character state information (Level only)
LevelPlayerState.points
Points counter (Read Only)
  • points uint
LevelPlayerState.coins
Coins counter (Read Only)
  • coins uint
LevelPlayerState.lives
Lives/Attempts counter (Read Only)
  • lives int
LevelPlayerState.attempts
Lives/Attempts counter, alias to lives (Read Only)
  • attempts int
LevelPlayerState.leeks
Count of stars/leeks (Read Only)
  • leeks uint
LevelPlayerState.stars
Count of stars/leeks, alias to leeks (Read Only)
  • stars uint
LevelPlayerState.health
Health level of player (Read Only)
  • health int
LevelPlayerState.characterID
ID of playable character (Read Only)
  • characterID ulong
LevelPlayerState.stateID
ID of playable character's state/suit/form/shape (Read Only)
  • stateID ulong
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)
  • playerID int
generated by LDoc 1.4.6 Last updated 2017-08-21 02:20:32