Using the RLFL map

Example:

map_number = rlfl.create_map(width, height)
p = (10, 10)
rlfl.set_flag(map_number, p, rlfl.CELL_LIT)

Function list

rlfl.create_map(width, height)

Return the number allocated to a new map.

rlfl.delete_map(map_number)

Delete map and free resources.

rlfl.delete_all_maps()

Delete all allocated maps.

rlfl.map_size(map_number)

Returns a (width, height) tuple.

rlfl.fill_map(map_number, flags)

Sets flags on all cells of the map.

rlfl.clear_map(map_number[, flags])

Clears flags on all cells of the map. If flags is omitted clears all flags.

rlfl.has_flag(map_number, p, flags)

Returns True if flag(s) are set on cell.

rlfl.set_flag(map_number, p, flags)

Set flag(s) on cell.

rlfl.clear_flag(map_number, p, flags)

Clear flag(s) on cell.

rlfl.get_flags(map_number, p)

Returns all flag(s) set on cell.

Map flags

Example:

rlfl.fill_map(map_number, rlfl.CELL_SEEN | rlfl.CELL_LIT)
rlfl.clear_map(map_number, rlfl.CELL_MEMO);
rlfl.CELL_DARK

Special flag. used internally.

rlfl.CELL_OPEN

Cell is walkable and does not block LOS or FOV.

rlfl.CELL_VIEW

Special flag. used internally.

rlfl.CELL_LIT

Cell is lit

rlfl.CELL_WALK

Special flag. Cell is walkable. (Illusion walls)

rlfl.CELL_MEMO

Cell is memorized.

rlfl.CELL_SEEN

Cell is in FOV.

rlfl.CELL_ROOM

Cell is part of a room.

rlfl.CELL_GLOW

Cell is permalit. Has own light source.

rlfl.CELL_PATH

Special flag. Cell is in a path.

rlfl.CELL_OCUP

Cell is occupied.

rlfl.CELL_PERM

Cell permanent wall. Blocks everything. This flag is set at map creation on the outmost walls of the map.

rlfl.CELL_REFL

Cell reflects some projections.

rlfl.CELL_PASS

Used for autoexplore-maps to mark passible things (like doors).

rlfl.CELL_GOAL

Goal point for use on custom pathmaps.

rlfl.CELL_MARK

Extra flag, use for whatever you like.

rlfl.CELL_MASK

Cell mask. All flags.

Table Of Contents

Previous topic

RogueLike Function Library

Next topic

Pathfinding

This Page