flatland
Flatland
A 2D tile-based role-playing game built with pygame
and powered by AI-controlled entities.
Features
- Object-oriented entity system with animated/inanimate NPCs
- Registry-based extensibility for new game objects
- Interaction Moderator for entity collision and effects
- Modular tile-based map system
- Simple LLM stub simulating character memory and decisions
- Unit tests included with pytest
- Ready for CI/CD via GitHub Actions
Development
# Install dependencies
make install
# Run the game in single player
make run
# Run tests
make test
Multiplayer
To run the game in multiplayer, simply do:
# on the server
make server
# on each client
python3 -m flatland.multiplayer --ip x.x.x.x --port xxxxx
Documentation
You can find the online documentation here.
Asset resources
I would like to signal this beautiful free website: https://opengameart.org/. It contains a lot of beautiful and well done 2D sprites that are perfect for our game.
1import os 2import pathlib 3 4if os.environ.get("VERBOSE_LOGS", None) is None: 5 os.environ["VERBOSE_LOGS"] = "false" 6 7if os.environ.get("GITHUB_ACTIONS") == "true": 8 os.environ["SDL_AUDIODRIVER"] = "dummy" 9 10from . import ( 11 __main__, 12 actions, 13 animations, 14 consts, 15 game, 16 interactions, 17 internal, 18 llm_stub, 19 multiplayer, 20 objects, 21 sensors, 22 world, 23) 24 25__doc__ = pathlib.Path(__file__).parent.parent / "README.md" # type: ignore 26__doc__ = __doc__.read_text() # type: ignore