-
Notifications
You must be signed in to change notification settings - Fork 0
Level API Documentation
Return Value: number BackgroundColor, number ForegroundColor, number TextCharacter
Returns the top-most (currently visible) texture there is based on the given coordinates.
Sets whether or not the user is in game.
Return Value: boolean
Returns true if the user is currently in game. false otherwise.
Sets whether or not the game is in single player mode.
Return Value: boolean
Returns true if the user is playing in singleplayer. false otherwise.
Return Value: table lightingMap
Returns the lighting map, used to tell the game where there is and isn't light.
Takes a number to set as the time in game. Can be any number between 0 and 24.
Return Value: number Time
Sets the world for other API's to refer to when functioning.
Return Value: table currentWorld
Returns the current world being used by other APIs.
Return Value: number worldWidth, number worldHeight
Returns the width and height of the world.
Sets the spawn point of the world where players will respawn at. _newSpawn _ should be in the format '{x, y}'.
Return Value: table spawnPoint
Returns a table value of the current spawnPoint in the format '{x, y}'.
Updates the specified area of the world by making liquids flow, grass grow, scripts run, etc.
Return Value: number or string ID
Takes an ID and converts it into it's string equivalent.
'Level.convertID(1)' Returns "Stone"
'Level.convertID("Stone")' Returns 1
Return Value: Boolean
Checks if there is a block obstructing a player or entity from going over given coordinates.
Sets the world data for the given point. newData is a table structured like this: local exampleData = { Block = {ID = Number or False}, Tile = {ID = Number or False} }
You can give both a Tile and Block to reassign, or just one. Level.setData(0, 10, 10, {Block = {ID = 1}}) This sets the block at 10, 10 in dimension 0 to 1, or stone.
Return Value: table { Block = {ID = Number or False}, Tile = {ID = Number or False} }
Returns the data of the world from the specified coordinates and dimension.
Sets the camera offset, affecting what part of the world the player will be seeing.
Return Value: number OffsetX, number OffsetY
Returns the current offset of the camera.
Return Value: table World
Generates a new world, just like the ones used in the game. It uses a premade world created by the function Level.newWorld()
Return Value: table WorldBase
Using this function will create a table for the function level.generateWorld() to use later.
Returns the current in game time.
This function is widely used in my world generation algorithum. However, it doesn't work at ALL how it should, and isn't recommended to be used.
Level.checkForIDs(number findID, boolean topLayer, number startX, number startY, number endX, number endY)
This function hasn't been completed yet.
Level.replaceIDs(number originalID, number newID, boolean topLayer, number startX, number startY, number endX, number endY)
This function hasn't been completed yet.
This needs a reason.