Skip to content

Entities

Bases: Entity, HasColour, Stochastic

Goals are entities that can be reached by the player

Bases: Entity, HasColour, Holder

Goals are entities that can be reached by the player

Directions enum class to store the directions in the game.

Bases: Entity, Openable, HasColour

Consumable items are world objects that can be consumed by the player. Consuming an item requires a tool (e.g. a key to open a door). A tool is an id (int) of another item, specified in the requires field (-1 if no tool is required). After an item is consumed, it is both removed from the state.entities collection, and replaced in the grid by the item specified in the replacement field (0 = floor by default). Examples of consumables are doors (to open) food (to eat) and water (to drink), etc.

Bases: PyTreeNode

Entities enum class to store the names of the entities in the game.

Bases: Positionable, HasTag, HasSprite

Entities are components that can be placed in the environment, and have a position and a tag. To create an entity, use the create method.

The name of the entity

Returns:

Name Type Description
str str

the name of the entity

The number of dimensions of the entity. The number of dimensions is the number of dimensions of the position minus 1.

The batch shape of the entity. The batch shape is the shape of the entity excluding the dimensions of the component. For example, if the entity has a position of shape (batch_size, 2), the shape of the entity is (batch_size,).

The transparent attribute of the entity. The transparent attribute is a boolean array that indicates if the entity is transparent to rendering.

The walkable attribute of the entity. The walkable attribute is a boolean array that indicates if the entity can be walked on.

EntityIds enum class to store the ids of the entities in the game.

Bases: Entity, HasColour, Stochastic

Goals are entities that can be reached by the player

Bases: Entity, Pickable, HasColour

Pickable items are world objects that can be picked up by the player. Examples of pickable items are keys, coins, etc.

Bases: Entity

Goals are entities that can be reached by the player

Bases: Entity, Directional, Holder

Players are entities that can act around the environment

Bases: Entity, HasColour

Walls are entities that cannot be walked through