1.14.03 - Dynamic tile

Dynamic tiles are tiles that can be hidden, shown, created and deleted at runtime.

This type of map entity can be declared in the map data file. It can also be created dynamically with map:create_dynamic_tile().

Overview

Dynamic tiles exist because normal tiles are optimized away at runtime. See Tiles are designed for performance for more details.

A typical usage of dynamic tiles is to make appear of disappear parts of the map because something happens: a puzzle is solved, an non-playing characters opens a path for you, water disappears, etc. Use dynamic_tile:set_enabled() to this end.

Remarks
Dynamic tiles can get enabled and disabled automatically to reflect the state of a door. If you give the appropriate name to your dynamic tile, the engine will enable or disable it depending on whether the door is open or closed. See the documentation of map:open_doors() for more information.

Methods inherited from map entity

Dynamic tiles are particular map entities. Therefore, they inherit all methods from the type map entity.

See Methods of all entity types to know these methods.

Methods of the type dynamic tile

The following methods are specific to dynamic tiles.

dynamic_tile:get_pattern_id()

Returns the id of the tile pattern of this dynamic tile.

dynamic_tile:get_modified_ground()

Returns the ground defined by this dynamic tile on the map.

The presence of a dynamic tile can modify the ground of the map. This is determined by the ground property of the tile pattern.

Events inherited from map entity

Events are callback methods automatically called by the engine if you define them.

Dynamic tiles are particular map entities. Therefore, they inherit all events from the type map entity.

See Events of all entity types to know these events.

Events of the type dynamic tile

None.