{"id":20638642,"url":"https://github.com/franzlor/housecatengine","last_synced_at":"2026-02-28T18:34:48.386Z","repository":{"id":226329717,"uuid":"767952154","full_name":"FranzLor/HousecatEngine","owner":"FranzLor","description":"An ECS game engine for 2D game development.","archived":false,"fork":false,"pushed_at":"2024-08-24T19:34:28.000Z","size":16802,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-10T07:36:10.654Z","etag":null,"topics":["2d-game-engine","cpp","ecs","game-development","game-engine","imgui","level-editor","lua-script","sdl2"],"latest_commit_sha":null,"homepage":"https://franzlor.com/housecat.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FranzLor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-06T07:44:32.000Z","updated_at":"2025-04-11T06:28:11.000Z","dependencies_parsed_at":"2024-08-24T20:50:33.709Z","dependency_job_id":null,"html_url":"https://github.com/FranzLor/HousecatEngine","commit_stats":null,"previous_names":["zerocalbacon/housecatengine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FranzLor/HousecatEngine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranzLor%2FHousecatEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranzLor%2FHousecatEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranzLor%2FHousecatEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranzLor%2FHousecatEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FranzLor","download_url":"https://codeload.github.com/FranzLor/HousecatEngine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranzLor%2FHousecatEngine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29946847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:21:26.597Z","status":"ssl_error","status_checked_at":"2026-02-28T18:19:38.892Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d-game-engine","cpp","ecs","game-development","game-engine","imgui","level-editor","lua-script","sdl2"],"created_at":"2024-11-16T15:18:59.463Z","updated_at":"2026-02-28T18:34:48.366Z","avatar_url":"https://github.com/FranzLor.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Housecat banner](https://github.com/FranzLor/HousecatEngine/assets/24239318/1f7f6453-6713-48f6-ae48-09712adc8e0f)\n\n`Housecat` is a lightweight and modular game engine designed to provide developers with a flexible and efficient framework for building 2D games. \nAt its core, it utilizes the Entity-Component-System (ECS) architecture, offering easier game object management and allowing for easy scalability and extensibility.\nThe engine offers developers a game project, that shows off the engine's capabilities and potential. It also offers a simple 2D level Editor, to help developers build their game projects.\n\n![Static Badge](https://img.shields.io/badge/In%20Development-darkgreen?style=flat) \u0026nbsp; ![Static Badge](https://img.shields.io/badge/version-v1.0-blue?style=flat)\n\n\n# Table of Contents\n1. [Intro](#intro)\n   - [Get Started](#get-started)\n   - [How to Use](#how-to-use)\n   - [Examples](#examples)\n2. [Features](#features)\n3. [Documentation](#documentation)\n4. [Contributions](#contributions)\n5. [License](#license)\n   \n# Intro\nThis engine was crafted to streamline the process of game development, especially for indie developers and small teams. Entity-Component-System (ECS) design pattern to decouple game logic and state representation, enabling flexible interaction and greater ease in maintaining, modifying, or extending complex game functionalities.\nThis architectural approach emphasizes in a more manageable and scalable code, which is beneficial in games with numerous interactive elements and systems.\u003cbr/\u003e\u003cbr/\u003e\nWant to learn more about the ECS paradigm? I recommend these links that got me started: \n- [ECS Game Engine Design (Daniel Hall, Cal Poly)](https://digitalcommons.calpoly.edu/cgi/viewcontent.cgi?article=1138\u0026context=cpesp)\n- [The Entity-Component-System - An awesome game-design pattern in C++ (Tobias Stein, Game Developer)](https://www.gamedeveloper.com/design/the-entity-component-system---an-awesome-game-design-pattern-in-c-part-1-)\n- [Entity Component System: An Introductory Guide (John Terra, Simplilearn)](https://www.simplilearn.com/entity-component-system-introductory-guide-article)\n  \n ## Get Started\nTo get started with Housecat, follow these steps:\n- Clone the Housecat repository to your local machine.\u003cbr/\u003e\n  ```git clone https://github.com/FRLor/Housecat.git```\n- Build the engine using the provided build instructions. (Refer to Appendix B, C, and D of Documentation)\n- Start creating your game using the Housecat framework and editor.\n   \n ## How to Use\n`Housecat` offers a straightforward approach to game development:\n- Define your game entities and components using the engine's robust ECS.\n- Utilize the Housecat Editor to design levels, manage assets, and script events.\n- Use the Asset Manager to easily handle game assets.\n- Incorporate custom behaviors and game logic with Lua scripting.\n\n## Examples\n### Using the Lua Script and LevelManager\n\nThis example demonstrates how to leverage `Housecat`'s LevelManager and Lua Scripting to dynamically load and configure game levels, streamlining the game setup process.\u003cbr/\u003e\u003cbr/\u003e\n\n**Initialize the Game and Load the Lua Script:**\nFirst, ensure that the game environment, including SDL, the Housecat ECS, and other systems, are initialized. Then, load the Lua script which contains the game's configuration, assets, and level design:\u003cbr/\u003e\n```\nGame game;\ngame.Initialize();\ngame.levelManager-\u003eLoadLevel(game.housecat, game.renderer, game.assetManager, game.lua, 1);\n```\n\n**Load Assets Using Lua Table Definitions:**\nThe Lua script defines all assets and their properties, which the LevelManager reads to load textures, fonts, and other resources:\u003cbr/\u003e\n```\nLevel = {\n    assets = {\n        { type = \"texture\", id = \"tileset\", file = \"./assets/textures/tileset.png\" },\n        { type = \"font\", id = \"main_font\", file = \"./assets/fonts/roboto.ttf\", font_size = 16 },\n        { type = \"sound\", id = \"background_music\", file = \"./assets/sounds/background.wav\" }\n    }\n}\n```\n\n**Configure the Level from Lua Script:**\nUtilize the Lua script to specify the layout, entities, and interactions within the level:\u003cbr/\u003e\n```\nLevel.tilemap = {\n    mapFilePath = \"./assets/levels/level1.map\",\n    textureID = \"tileset\",\n    tileSize = 32,\n    tileScale = 2.0\n}\n```\n\n**Instantiate Entities Defined in Lua:**\nCreate game entities using the configurations specified in the Lua script. Each entity's components and behaviors can be customized through Lua:\u003cbr/\u003e\n```\nLevel.entities = {\n    {\n        tag = \"player\",\n        components = {\n            transform = { position = { x = 100, y = 150 }, scale = { x = 2.0, y = 2.0 }},\n            sprite = { textureID = \"player_texture\", width = 32, height = 32 },\n            movement = { speed = 200 }\n        }\n    }\n}\n```\n\n**Read and Apply Entity Components from Lua:**\nInstantiation of entities and their components involves parsing Lua tables to dynamically assign attributes and functionalities, as demonstrated here:\u003cbr/\u003e\n```\nsol::table entities = lua[\"Level\"][\"entities\"];\nfor (auto\u0026 entity : entities) {\n    Entity newEntity = game.housecat-\u003eCreateEntity();\n    if (entity[\"tag\"]) {\n        newEntity.Tag(entity[\"tag\"]);\n    }\n    if (entity[\"components\"][\"transform\"]) {\n        newEntity.AddComponent\u003cTransformComponent\u003e(\n            glm::vec2(entity[\"components\"][\"transform\"][\"position\"][\"x\"], entity[\"components\"][\"transform\"][\"position\"][\"y\"]),\n            glm::vec2(entity[\"components\"][\"transform\"][\"scale\"][\"x\"], entity[\"components\"][\"transform\"][\"scale\"][\"y\"]),\n            entity[\"components\"][\"transform\"][\"rotation\"]\n        );\n    }\n    // Additional components like SpriteComponent, UserControlComponent, etc., are added similarly\n}\n```\n\u003cbr/\u003e\u003cbr/\u003e\n\n\n### Without the Lua Script and LevelManager\nThis first example demonstrates how to create a simple 2D game using `Housecat`'s features, showcasing the setup of a basic game environment, entity creation, and game loop management.\u003cbr/\u003e\u003cbr/\u003e\n\n**Initialize the Game Environment:**\nStart by setting up the SDL library, creating a window, and preparing the renderer. Initialize the Housecat ECS framework to manage game entities and components:\n```\nGame game;\u003cbr/\u003e\ngame.Initialize();\u003cbr/\u003e\n```\n\n**Load Game Assets:**\nBefore creating entities, load all necessary textures, fonts, and sounds using the AssetManager. This ensures that all game resources are available for use:\n```\ngame.assetManager-\u003eAddTexture(game.renderer, \"playerTexture\", \"assets/textures/player.png\");\u003cbr/\u003e\ngame.assetManager-\u003eAddFont(\"roboto\", \"assets/fonts/roboto.regular.ttf\", 16);\u003cbr/\u003e\ngame.assetManager-\u003eAddSound(\"jumpSound\", \"assets/sounds/jump.wav\");\u003cbr/\u003e\u003cbr/\u003e\n```\n\n**Create Game Entities:**\nCreate entities such as a player and attach necessary components to them. Components define the properties and behavior of entities:\n```\nEntity player = game.housecat-\u003eCreateEntity();\u003cbr/\u003e\nplayer.AddComponent\u003cTransformComponent\u003e(Vector2(100, 100), Vector2(1.0f, 1.0f), 0.0f);\u003cbr/\u003e\nplayer.AddComponent\u003cSpriteComponent\u003e(\"playerTexture\", 32, 32);\u003cbr/\u003e\nplayer.AddComponent\u003cUserControlComponent\u003e();\u003cbr/\u003e\u003cbr/\u003e\n```\n\u003cbr/\u003e\n\n### Call Housecat to Grab Necessary Systems and Updates\nOnce your game setup is complete and all resources are loaded, you can begin managing the game logic and rendering by integrating the engine's systems. To handle the rendering of entities, you must first add the necessary systems to your `Housecat` instance and then periodically update them in your game loop.\u003cbr/\u003e\n\n**Add Necessary Systems:**\nBefore starting the game loop, ensure all relevant systems are registered with `Housecat`. This includes systems for rendering, input handling, physics, animations, and any other functionalities your game requires:\u003cbr/\u003e\n```\nhousecat-\u003eAddSystem\u003cRenderSystem\u003e();\nhousecat-\u003eAddSystem\u003cMovementSystem\u003e();\nhousecat-\u003eAddSystem\u003cCollisionSystem\u003e();\n```\n**Update Systems in Game Loop:**\nWithin your game's main loop, call the update methods on each system to process all entities and their components.\n```\nhousecat-\u003eGetSystem\u003cMovementSystem\u003e().Update(deltaTime);\nhousecat-\u003eGetSystem\u003cCollisionSystem\u003e().Update();\nhousecat-\u003eGetSystem\u003cRenderSystem\u003e().Update(game.renderer, game.assetManager, game.camera);\n```\n\u003cbr/\u003e\u003cbr/\u003e\n\n# Features\nThis repository comes with three main features right off the bat: the `Housecat` game engine itself, the level Editor, and a Game project.\u003cbr/\u003e\nHere is a list of the features that this project has to offer to game developers:\n- **ECS Core Architecture:**\n  - Efficient Entity Management: Entities are lightweight identifiers that allow for flexible management and combination of gameplay components.\n  - Modular Component System: Encourages reusable code and data-driven design, making it easier to add new types of behaviors or features without altering existing systems.\n  - Dynamic System Interaction: Systems operate on components, making it easy to define complex interactions in a highly decoupled manner.\n    \n- **Level Editor:**\n  - **Level Design Tools:** Tools for creating and modifying game levels and design directly within the editor.\n  - **Asset Management Integration:** Seamlessly import, organize, and manage game assets within the editor.\n  - **ImGui-Powered UI:** Utilizes ImGui to create a user-friendly, responsive, and highly customizable editor interface, enhancing the overall development experience.\n  - **FontAwesome6 Icons:** Integrates FontAwesome6 to style the UI with scalable icons, improving visual clarity and aesthetic appeal of the editor's interface.\n \n    ![housecat-editor](https://github.com/user-attachments/assets/726bb117-0858-4175-9273-4252d6cb096a)\n\n \n- **Cat Game:**\n  - **2D Game:** Showcases the capabilities of the `Housecat` game engine through an engaging and developed 2D game.\n  - **Customizable Gameplay:** Developers can extend and customize the game using Lua script, allowing for dynamic gameplay changes and enhancements.\n  - **Integrated Level Management:** Utilizes the LevelManager system for seamless level transitions and management.\n  - **Educational Resource:** Serves as a practical example for developers to learn how to utilize various aspects of the Housecat game engine in a real-world scenario.\n \n    ![housecat-game](https://github.com/user-attachments/assets/f1873a00-2fef-4e16-93c5-0e60ea942c92)\n\n\n- **Housecat Manager / Registry:**\n  - **Entity Lifecycle Management:** Calling `Housecat` simplifies the creation, modification, and destruction of entities within your game project.\n  - **Tagging and Grouping:** Allows entities to be tagged or grouped for efficient querying and batch operations.\n\n- **Asset Manager:**\n  - **Resource Loading:** Manage loading and unloading of assets such as textures, fonts, sounds, and scripts to optimize memory usage.\n  - **Asset Caching:** Uses SDL by implementing caching mechanisms to speed up asset retrieval and reduce load times.\n  - **Extensible for Various Asset Types:** Easily extendable to support new asset types as needed by the game.\n\n- **Event Manager:**\n  - **Subscriber-Listener Paradigm:** Employs a subscriber-listener design to manage interactions within the game engine, allowing components to subscribe to and listen for specific events without direct coupling.\n  - **Custom Event Types:** Enables developers to define and trigger custom events tailored to their game's needs, enhancing the flexibility of game mechanics and interactions.\n  - **Efficient Event Handling:** Optimizes event processing, including support for asynchronous handling, to improve responsiveness and reduce performance overhead.\n\n- **Lua Script Integration:**\n  - **Flexible Scripting with Lua:** Leverages Lua to define game elements and behaviors dynamically through scripts. Developers can use Lua to define asset tables, set up game entities, and script complex interactions.\n  - **Dynamic Behavior Modification:** Facilitates runtime changes to game logic and entity behavior without recompilation, supporting dynamic binding through the script system. This allows for on-the-fly adjustments and rapid iteration.\n  - **API Access:** Provides Lua scripts with extensive access to the game engine's API, enabling direct manipulation of entities and components, offering more creative freedom and control over game mechanics.\n \n    ![housecat-scripting](https://github.com/user-attachments/assets/55b4656e-60cb-43f1-915a-1272beb11887)\n\n\n- **Modular Rendering System:**\n  - **2D Graphics Support:** Built primarily for 2D game development, utilizing SDL2 for rendering sprites, textures, and animations efficiently.\n  - **Culling and Optimization:** Implements culling to only render entities visible in the camera's viewport, optimizing processing and rendering load.\n  - **Text Rendering:** Supports text rendering using SDL_ttf, allowing for dynamic text displays within the game, ideal for UI elements and game notifications.\n\n- **Input Management:**\n  - **SDL Integration for Input Handling:** Leverages SDL for comprehensive input management, capturing events from keyboards and mice for responsive gameplay.\n  - **ECS-Driven Event Handling:** Utilizes the ECS architecture to dispatch input-related events, ensuring seamless integration with game entity behaviors and state changes.\n \n- **Logger:**\n  - **Comprehensive Logging:** Provides a robust logging system that captures a wide range of information including debug messages, warnings, and errors.\n  - **Real-Time Feedback:** Enables real-time logging feedback in the console, helping developers to quickly identify and resolve issues during development.\n  - **Severity Levels:** Supports different levels of log severity (info, warning, error, debug), allowing developers to filter logs based on their current needs.\n  - **Integration with Editor:** Fully integrated within the Housecat Editor, facilitating a seamless development experience by providing immediate access to logs directly within the development environment.\n\n\n# Documentation\nThe `Housecat` Wiki page is still in development. But it's worth checking out for updates!\u003cbr/\u003e\n[Housecat Wiki](https://github.com/FranzLor/HousecatEngine/wiki).\u003cbr/\u003e\u003cbr/\u003e\nThe wiki will help you get the most out of the engine and streamline your game development process.\u003cbr/\u003e\n\nFor those who want to get started right away, in the Source folder, each file will contain Documentation on its purpose, usage, and other useful commentary.\n\n\n# Contributions\n   Any contributions to improve and extend `Housecat` are all welcome!\u003cbr/\u003e\u003cbr/\u003e\n   However, I cannot guarantee that each contribution will be accepted.\u003cbr/\u003e\n   If you have any requests for more features, bug fixes, and even constructive criticism, feel free to DM me through my [GitHub](https://github.com/FranzLor).\n\n\n# License\n   `Housecat` is licensed under the MIT License. See the [MIT License](https://github.com/FranzLor/HousecatEngine/blob/master/LICENSE.txt) file for more information.\u003cbr/\u003e\u003cbr/\u003e\n   Each asset used for the Cat Game project were all free and downloaded from [itch.io](https://itch.io/). The owners granted expressive use for their respective assets.\n   However, I have also provided some of their Licenses, that were provided, as a way to credit their \n creative work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranzlor%2Fhousecatengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranzlor%2Fhousecatengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranzlor%2Fhousecatengine/lists"}