{"id":21409999,"url":"https://github.com/defini7/consolegameengine","last_synced_at":"2025-03-16T17:46:31.143Z","repository":{"id":58144544,"uuid":"403236733","full_name":"defini7/ConsoleGameEngine","owner":"defini7","description":"ConsoleGameEngine is a game engine in Windows Command Prompt!","archived":false,"fork":false,"pushed_at":"2025-02-26T20:06:11.000Z","size":394,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T21:19:50.153Z","etag":null,"topics":["command-prompt","game-development","gamedev","windows-10"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defini7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2021-09-05T06:49:43.000Z","updated_at":"2025-02-26T20:06:15.000Z","dependencies_parsed_at":"2023-10-16T08:54:55.287Z","dependency_job_id":"a796729d-24e4-48c9-ab8d-2842e62a778c","html_url":"https://github.com/defini7/ConsoleGameEngine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defini7%2FConsoleGameEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defini7%2FConsoleGameEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defini7%2FConsoleGameEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defini7%2FConsoleGameEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defini7","download_url":"https://codeload.github.com/defini7/ConsoleGameEngine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910715,"owners_count":20367538,"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":["command-prompt","game-development","gamedev","windows-10"],"created_at":"2024-11-22T17:36:30.345Z","updated_at":"2025-03-16T17:46:31.108Z","avatar_url":"https://github.com/defini7.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **ConsoleGameEngine**\n\n## Description\n\nConsoleGameEngine is a simple game engine that can be used for building games and applications in the Windows Command Prompt\n\n## Documentation\n\n### Example\n\nLet's take a look on an example:\n\n```c++\n#define CGE_IMPL\n#include \"ConsoleGameEngine.hpp\"\n\nclass Example : public ConsoleGameEngine\n{\npublic:\n\tExample()\n\t{\n\t\tsAppName = L\"Example\";\n\t}\nprotected:\n\tvirtual bool OnUserCreate() override\n\t{\n\t\treturn true;\n\t}\n\tvirtual bool OnUserUpdate(float fDeltaTime) override\n\t{\n\t\treturn true;\n\t}\n};\n\nint main()\n{\n\tExample demo;\n\t\n\tif (demo.ConstructConsole(256, 240, 4, 4) == rcode::OK)\n\t\tdemo.Run();\n\t\n\treturn 0;\n}\n```\n\nFirst of all we need to include `ConsoleGameEngine.hpp`. \n\nThen we need to create a class, that publicly inherits from `ConsoleGameEngine` class. Then we need to override a constructor, to set the application name and then we do the same with 2 virtual methods: `OnUserCreate` and `OnUserUpdate`, the second method takes as parameter `fDeltaTime`. They should return `true` to prevent exiting from application. `OnUserCreate` is being called only once, and `OnUserUpdate` on every frame.\n\nNow we need to create a `main` function, after that we must create instance of our derived class, then we create an if statement with calling `ConstructConsole` method where we pass screen width, screen height, font width and font height, if it returns `rcode::OK`, we can call `Run` method.\n\n## Additional\n\n1. [Sprite Editor](https://github.com/defini7/SpriteEditor)\n\n## License\n\nBSD 3-Clause License\n\nCopyright (c) 2021 - 2024 Alex\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefini7%2Fconsolegameengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefini7%2Fconsolegameengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefini7%2Fconsolegameengine/lists"}