{"id":24857407,"url":"https://github.com/gmitch215/cmdfx","last_synced_at":"2025-04-12T21:51:15.175Z","repository":{"id":273265619,"uuid":"912174031","full_name":"gmitch215/cmdfx","owner":"gmitch215","description":"🎮 A Game Engine for your Terminal","archived":false,"fork":false,"pushed_at":"2025-04-05T00:56:33.000Z","size":1889,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T01:28:55.917Z","etag":null,"topics":["c","cmake","cmdfx","cpp","game","game-engine","library"],"latest_commit_sha":null,"homepage":"https://gmitch215.github.io/cmdfx/","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/gmitch215.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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},"funding":{"patreon":"gmitch215","liberapay":"gmitch215","buy_me_a_coffee":"gmitch215"}},"created_at":"2025-01-04T20:13:04.000Z","updated_at":"2025-04-05T00:56:36.000Z","dependencies_parsed_at":"2025-01-19T21:39:43.945Z","dependency_job_id":"38197da0-1191-466a-85b0-76de33f93b0b","html_url":"https://github.com/gmitch215/cmdfx","commit_stats":null,"previous_names":["gmitch215/cmdfx"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fcmdfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fcmdfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fcmdfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fcmdfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmitch215","download_url":"https://codeload.github.com/gmitch215/cmdfx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637832,"owners_count":21137538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c","cmake","cmdfx","cpp","game","game-engine","library"],"created_at":"2025-01-31T17:53:27.746Z","updated_at":"2025-04-12T21:51:15.169Z","avatar_url":"https://github.com/gmitch215.png","language":"C","readme":"\u003cdiv style=\"display: flex; align-items: center; flex-direction: column;\" align=\"center\"\u003e\n    \u003cimg align=\"center\" style=\"align-self: center; max-width: 256px\" src=\"https://cdn.gmitch215.xyz/cmdfx.png\" width=\"30%\" alt=\"\" /\u003e\n    \u003ch1 style=\"text-align: center;\"\u003eCmdFX\u003c/h1\u003e\n    \u003cp style=\"text-align: center;\"\u003eA lightweight game engine for your terminal.\u003c/p\u003e\n    \u003cdiv align=\"center\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/release/gmitch215/cmdfx\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/downloads/gmitch215/cmdfx/total\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/gmitch215/cmdfx\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/stars/gmitch215/cmdfx?style=flat\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commit-activity/t/gmitch215/cmdfx?color=violet\"\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n---\n\n**cmdfx** is a lightweight game engine for your terminal, allowing you to create some pretty wild things. It is designed to be simple and easy to use, while still providing a powerful set of features.\n\nIt is written in C and is available cross-platform. It is licensed under the MIT license.\n\n## 🍎 Features\n\n- **Cross-platform**: cmdfx is available on Windows, macOS, and Linux.\n- **Lightweight**: cmdfx is designed to be lightweight and fast.\n- **Easy to use**: cmdfx is simple to use and easy to learn.\n- **Powerful**: cmdfx provides a powerful set of features for creating terminal-based games.\n\n### 📋 Highlighted Features\n\nFor a full method list, check out the [documentation](https://gmitch215.github.io/cmdfx/).\n\n- **Events API**\n  - Handle window events such as key presses and window resizing.\n  - Get the current state of the keyboard.\n- **Canvas API**\n  - Draw characters and shapes on the terminal.\n  - Set foreground and background colors.\n  - Clear the screen.\n  - Get the size of the terminal and the screen.\n  - ...and much more!\n  - **Sprites API**\n    - Load and draw sprites on the terminal.\n    - Set the color of a sprite.\n    - Create Gradients for a sprite.\n    - ...and much more!\n- **Builder API**\n  - Easily build 2D arrays of characters and strings.\n  - Set the color of the text.\n  - Create gradients of text and colors!\n  - ...and much more!\n- **Physics Engine**\n  - Create and manage physics objects with the Sprite API.\n  - Set the velocity and acceleration of a sprite.\n  - Detect collisions between sprites.\n  - ...and much more!\n- **Input API**\n  - Get the current state of the keyboard and mouse events.\n  - Handle key presses and key releases.\n  - ..and much more!\n- **Cross-Platform Exposure**\n  - Expose platform-specific features and utilities such as setting the title of the terminal.\n\n## 📦 Installation\n\nYou can download the latest release of cmdfx from the [releases page](https://github.com/gmitch215/cmdfx/releases).\n\n## 🚀 Examples\n\n```c\n#include \u003ccmdfx.h\u003e\n\nint main() {\n    // Set character at position (4, 4) to 'X'\n    Canvas_setChar(4, 4, 'X');\n\n    // Draw Circle with '#' at position (10, 10) with radius 5\n    Canvas_fillCircle(10, 10, 5, '#');\n\n    // Set Foreground to Red, then draw a line from (0, 0) to (10, 0)\n    Canvas_setForeground(0xFF0000);\n    Canvas_hLine(0, 0, 10);\n}\n\n```\n\n```c\n#include \u003ccmdfx.h\u003e\n\nint main() {\n    // (path, z-index)\n    CmdFX_Sprite* mySprite = Sprite_loadFromFile(\"sprite.txt\", 0);\n    Sprite_setForegroundAll(mySprite, 0xFF0000); // Set Color to Red\n\n    // Draw Sprite at position (5, 5)   \n    Sprite_draw(5, 5, mySprite);\n\n    // Move Sprite to position (10, 10)\n    Sprite_moveTo(mySprite, 10, 10);\n    \n    // (width, height, char, ansi, z-index)\n    CmdFX_Sprite* background = Sprite_createFilled(10, 10, '#', 0, 0);\n\n    // Set Gradient to Foreground with Red, Green, and Gold\n    Sprite_setForegroundGradientAll(background, GRADIENT_ANGLE_45, 0xFF0000, 0x00FF00, 0xFFD700);\n}\n\n```\n\n```c\n#include \u003cstdio.h\u003e\n#include \u003ccmdfx.h\u003e\n\n// Detect when the terminal window is resized\nint onResize(CmdFX_Event* event) {\n    // Get payload data\n    CmdFX_ResizeEvent* resizeEvent = (CmdFX_ResizeEvent*) event-\u003edata;\n\n    // Print the previous and new size of the terminal\n    printf(\"Terminal resized from %dx%d to %dx%d\\n\", resizeEvent-\u003eprevWidth, resizeEvent-\u003eprevHeight, resizeEvent-\u003enewWidth, resizeEvent-\u003enewHeight);\n    \n    return 0;\n}\n\nint main() {\n    int r = 0;\n\n    Canvas_clearScreen();\n    addCmdFXEventListener(CMDFX_EVENT_RESIZE, onResize);\n\n    while (1) {\n        // Do nothing while we wait for an event\n    }\n}\n```\n\nMore examples can be found in the [samples directory](/samples).\n\n## 📝 Contributing\n\nIf you would like to contribute to cmdfx, please see the [contributing guidelines](CONTRIBUTING.md). All contributions are welcome!\n","funding_links":["https://patreon.com/gmitch215","https://liberapay.com/gmitch215","https://buymeacoffee.com/gmitch215"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmitch215%2Fcmdfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmitch215%2Fcmdfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmitch215%2Fcmdfx/lists"}