adore namespace¶
This is the main Adore namespace where all the adore functions are stored.
Note
You should not directly edit any values within this namespace unless you know what you are doing.
Function Reference¶
-
adore.getGameDT()¶ Returns: the delta time in seconds
Returns the time it took for the last frame to run. This will just be the reciprocal of the frame rate at the moment since dynamic frame rates are not supported.
-
adore.event(name, priority, fn)¶ Arguments: - name (string) – name of the event to hook
- priority (number) – The priority of the event, lower is more important
- fn (function) – The callback function.
The signature of the function passed to adore.event will depend on the
event hooked on to. A list of events can be found here(TODO)
-
adore.getGame()¶ Returns: The current game
Returns the currently loaded game object
-
adore.doOnce(key)¶ Arguments: - key (string) – A unique key
Returns: trueif the action should be performed,falseotherwise.
Perform an action exactly once by querying a persistent dictionary
Example:
if adore.doOnce("get banana") then
aBill:say("I picked up the banana")
else
aBill:say("No, I've already picked up the banana")
end
-
adore.queryScreen(x, y)¶ Arguments: - x (number) – The X coordinate in screen-space
- y (number) – The Y coordinate in screen-space
Returns: The object and its type
Example:
local obj, type = adore.queryScreen(mx,my)
-
adore.quit()¶
Causes the engine to quit
-
adore.wait(time)¶ Arguments: - time (number) – The number of loops to wait
Holds the current script for the number of game loops specified. The script will not return until the wait time has elapsed
-
adore.isBlocked()¶ Returns: trueif blocked,falseotherwise
Checks if the Adore scripting loop is currently blocked by a script action.
-
adore.reloadAssets()¶
Causes Adore to reload all character walk sets and scene backgrounds/sprites/masks