Major implementation of the full sequence protocol for both UICollection and UIEntityCollection, making them behave like proper Python sequences. Core Features Implemented: - __setitem__ (collection[i] = value) with type validation - __delitem__ (del collection[i]) with proper cleanup - __contains__ (item in collection) by C++ pointer comparison - __add__ (collection + other) returns Python list - __iadd__ (collection += other) with full validation before modification - Negative indexing support throughout - Complete slice support (getting, setting, deletion) - Extended slices with step \!= 1 - index() and count() methods - Type safety enforced for all operations UICollection specifics: - Accepts Frame, Caption, Sprite, and Grid objects only - Preserves z_index when replacing items - Auto-assigns z_index on append (existing behavior maintained) UIEntityCollection specifics: - Accepts Entity objects only - Manages grid references on add/remove/replace - Uses std::list iteration with std::advance() Also includes: - Default value support for constructors: - Caption accepts None for font (uses default_font) - Grid accepts None for texture (uses default_texture) - Sprite accepts None for texture (uses default_texture) - Entity accepts None for texture (uses default_texture) This completes Issue #69, removing it as an Alpha Blocker. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
---|---|---|
.archive | ||
assets | ||
deps/platform | ||
modules | ||
src | ||
tests | ||
.gitignore | ||
.gitmodules | ||
CLAUDE.md | ||
CMakeLists.txt | ||
GNUmakefile | ||
LICENSE.md | ||
README.md | ||
ROADMAP.md | ||
automation_example.py | ||
automation_exec_examples.py | ||
build.sh | ||
clean.sh | ||
compile_commands.json | ||
css_colors.txt | ||
debug_immediate.png | ||
debug_multi_0.png | ||
debug_multi_1.png | ||
debug_multi_2.png | ||
example_automation.py | ||
example_config.py | ||
example_monitoring.py | ||
exec_flag_implementation.cpp | ||
generate_color_table.py | ||
gitea_issues.py | ||
grid_none_texture_test_197.png | ||
issue78_fixed_1658.png | ||
screenshot_opaque_fix_20250703_174829.png | ||
timer_success_1086.png | ||
validate_screenshot_basic_20250703_174532.png | ||
validate_screenshot_final_20250703_174532.png | ||
validate_screenshot_with_spaces 20250703_174532.png | ||
wikicrayons_colors.txt | ||
xkcd_colors.txt |
README.md
McRogueFace
A Python-powered 2D game engine for creating roguelike games, built with C++ and SFML.
Latest Release: Successfully completed 7DRL 2025 with "Crypt of Sokoban" - a unique roguelike that blends Sokoban puzzle mechanics with dungeon crawling!
Features
- Python-First Design: Write your game logic in Python while leveraging C++ performance
- Rich UI System: Sprites, Grids, Frames, and Captions with full animation support
- Entity-Component Architecture: Flexible game object system with Python integration
- Built-in Roguelike Support: Dungeon generation, pathfinding, and field-of-view via libtcod
- Automation API: PyAutoGUI-compatible testing and demo recording
- Interactive Development: Python REPL integration for live game debugging
Quick Start
# Clone and build
git clone https://github.com/jmcb/McRogueFace.git
cd McRogueFace
make
# Run the example game
cd build
./mcrogueface
Example: Creating a Simple Scene
import mcrfpy
# Create a new scene
mcrfpy.createScene("intro")
# Add a text caption
caption = mcrfpy.Caption(50, 50, "Welcome to McRogueFace!")
caption.font = mcrfpy.default_font
caption.font_color = (255, 255, 255)
# Add to scene
mcrfpy.sceneUI("intro").append(caption)
# Switch to the scene
mcrfpy.setScene("intro")
Documentation
For comprehensive documentation, tutorials, and API reference, visit: https://mcrogueface.github.io
Requirements
- C++17 compiler (GCC 7+ or Clang 5+)
- CMake 3.14+
- Python 3.12+
- SFML 2.5+
- Linux or Windows (macOS untested)
Project Structure
McRogueFace/
├── src/ # C++ engine source
├── scripts/ # Python game scripts
├── assets/ # Sprites, fonts, audio
├── build/ # Build output directory
└── tests/ # Automated test suite
Contributing
McRogueFace is under active development. Check the ROADMAP.md for current priorities and open issues.
License
This project is licensed under the MIT License - see LICENSE file for details.