Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

level

DDR0 edited this page · 5 revisions

The level variable can be accessed anywhere, from any object. It returns a variety of values accessible via the dot operator. For example, to get a list of objects in the level, we might ask for level.chars. Here is a list of all the data in level:

name rights contents
active_chars r
camera_position rw Returns list containing the upper-left corner x/y coordinates of the screen and the width/height of the screen. It may be set to a two-element list containing an x/y pair to instantly snap the camera to a position. Note that, unlike most variables, the value you set it to is different than the value it returns.
chars_immune_from_freeze w
chars r Contains a list of every object in the level.
cycle r An integer value telling how many frames have passed since the level was loaded.
debug_properties rw A list of variables of each object to print on-screen, in front of the object. Example: In the debug console, try set(level.debug_properties, ['type', 'x', 'y', 'hitpoints']).
dimensions rw
editor_selection r A list containing the currently selected editor objects.
focus rw
gui r
id r
in_dialog r
in_dialog w
in_editor r
is_paused r Returns true if the game is currently paused. Useful in some cases in the editor.
local_player r
lock_screen w
num_active r
num_segments r
player r The player object.
segment_height r
segment_width r
time_freeze rw
zoom rw
Something went wrong with that request. Please try again.