Skip to main content
The LevelColor enum identifies the twelve distinct colors used to label portal sides in a RollingQuest level. Each portal entrance or exit is associated with one of these colors, and you use the enum value to retrieve or configure that portal side via calls such as Level.getPortalSide(color). Choosing the right color constant ensures your script targets the correct portal when multiple portals exist in the same level.

Values

ValueNumberDescription
LevelColor.Red0Red portal side.
LevelColor.Blue1Blue portal side.
LevelColor.Green2Green portal side.
LevelColor.Yellow3Yellow portal side.
LevelColor.Cyan4Cyan portal side.
LevelColor.Orange5Orange portal side.
LevelColor.Violet6Violet portal side.
LevelColor.Magenta7Magenta portal side.
LevelColor.Turquoise8Turquoise portal side.
LevelColor.Lime9Lime portal side.
LevelColor.Salmon10Salmon portal side.
LevelColor.White11White portal side.

Usage Example

The example below retrieves the red portal side and enables it, then retrieves the blue portal side and disables it based on a game condition:
-- Enable the red portal side at the start of the level
local redPortal = Level.getPortalSide(LevelColor.Red)
redPortal:setEnabled(true)

-- Disable the blue portal side until the player collects all items
local bluePortal = Level.getPortalSide(LevelColor.Blue)
bluePortal:setEnabled(false)

function onAllItemsCollected()
    Level.getPortalSide(LevelColor.Blue):setEnabled(true)
end
You can also iterate over several colors to reset all portals at once:
local colorsToReset = {
    LevelColor.Red,
    LevelColor.Green,
    LevelColor.Yellow,
    LevelColor.Cyan,
}

for _, color in ipairs(colorsToReset) do
    Level.getPortalSide(color):setEnabled(false)
end