Building blocks¶
Codebase is divided in two main pieces pyherc
and herculeum
.
pyherc is a sort of platform or library for writing roguelike games. herculeum
on the other hand is a sample game that has been written on top of pyherc.
On a high level, pyherc and herculeum codebases are divided as detailed below:
Convenient links to each of main components
pyherc:
pyherc
pyherc.ai
pyherc.config
pyherc.data
pyherc.debug
pyherc.events
pyherc.generators
pyherc.rules
pyherc.test
herculeum:
herculeum
herculeum.config
herculeum.gui
Main components¶
Model¶
pyherc.data.model.Model
is the main class representing
current state of the playing world. It holds reference to important things like:
- Player character
- Dungeon
- Configuration
- Various tables
Character¶
pyherc.data.character.Character
is used to represent both player
character and monsters. It manages things like:
- Stats
- Inventory
- Location
Dungeon¶
pyherc.data.dungeon.Dungeon
is currently very sparse and is only
used to hold reference to first level in the dungeon.
Level¶
pyherc.data.level.Level
is key component, as it is used to store
layout and content of levels where player adventures. It manages:
- Shape of the level, including stairs leading to other levels
- Items
- Characters
Rules¶
pyherc.rules
is what defines what kind of actions player and monsters
are allowed to take and how they affect the world around them. Rules for things
like moving, fighting and drinking potions are found here. Refer to
Actions for more detailed description how actions are created and how to
add more.