{"id":22763239,"url":"https://github.com/thangisme/spectra","last_synced_at":"2025-07-28T05:33:17.734Z","repository":{"id":232100203,"uuid":"763089746","full_name":"thangisme/Spectra","owner":"thangisme","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-17T04:09:03.000Z","size":46572,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T09:41:35.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thangisme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-02-25T14:33:38.000Z","updated_at":"2025-03-17T08:48:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9fa34ef-5815-43ce-87dc-d2ec5750debe","html_url":"https://github.com/thangisme/Spectra","commit_stats":null,"previous_names":["thangisme/spectra"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thangisme/Spectra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangisme%2FSpectra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangisme%2FSpectra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangisme%2FSpectra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangisme%2FSpectra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thangisme","download_url":"https://codeload.github.com/thangisme/Spectra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangisme%2FSpectra/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267468390,"owners_count":24092334,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-11T11:07:42.340Z","updated_at":"2025-07-28T05:33:17.699Z","avatar_url":"https://github.com/thangisme.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/thangisme/Spectra/actions/workflows/cmake-sdl2-build.yml/badge.svg)](https://github.com/thangisme/Spectra/actions/workflows/cmake-sdl2-build.yml)\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n\n\u003ch3 align=\"center\"\u003eSpectra\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Simple shooting game built with SDL2\n    \u003cbr /\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n## Gameplay demo\nYou can view the demo video on [Youtube](https://www.youtube.com/watch?v=O_9oMhhOk9w)\n\n### Screenshot\n| ![splashscreen](assets/screenshots/splash_screen.png) | ![guidescreen](assets/screenshots/guide_screen.png) | ![winscreen](assets/screenshots/win_screen.png) |\n|:-----------------------------------------------------:|:---------------------------------------------------:|:-----------------------------------------------:|\n|                      Start menu                       |                  New player screen                  |                   Win screen                    |\n\n| ![map1](assets/screenshots/map1.png) | ![map1](assets/screenshots/map2.png) |\n|:------------------------------------:|:------------------------------------:|\n|                Map 1                 |                Map 2                 |\n\n## Technical design overview\nThe game's functionalities are organized into separate classes, utilizing Object-Oriented Programming (OOP) principles to make the codebase more modular and maintainable.\n\nThe `Game` class acts like the brain of the program, control various parts of the game.\n* `TextureManager` class is responsible for loading and rendering textures. \n* `SoundManager` class is responsible for loading and playing sound effects. \n* `InputManager` class is responsible for handling user input.\n* The `GameObject` class is the base class for all game objects, which includes the player, enemies, bullets, ... Each of these classes inherits from the `GameObject` class and implements their own functionalities.\n\nThe core game loop is implemented in the `Game` class, which handle events -\u003e update game objects -\u003e render game objects -\u003e repeat.\nUpdate loop basically calls the `GameStateManager` class to handle the current state. \nMost of state classes are also inherit from the `MenuState` class which base class is `GameState`. \nThese classes call `StateParser` class to parse the data from an external XML file which then render various game objects on the screen. The **[tinyxml2](https://github.com/leethomason/tinyxml2)** library is used to parse the XML file.\n\nThe only exception is the `PlayState` class which call the `LevelParser` class instead. This class also parses the data from an external map file, but designed specifically for handling the [Tiled](https://www.mapeditor.org/) map file format. The [base64](https://github.com/ReneNyffenegger/cpp-base64) and [zlib](https://www.zlib.net/) libraries are used to decode the map data.\n\nDue to the space between frame in some object sprite sheets, the collision detection is not pixel-perfect. Instead, the `CollisionManager` class check for outer edges of the object minus a fixed offset to determine the collision.\n\n## Download\nWindows users can download the latest release [here](https://github.com/thangisme/Spectra/releases).\n\n## Build and Run\n### Prerequisites\n\nFirst, you need to make sure to have the following dependencies installed on your machine:\n* [CMake](https://cmake.org/download/)\n* [SDL2](https://www.libsdl.org/download-2.0.php)\n* [SDL2_image](https://www.libsdl.org/projects/SDL_image/)\n* [SDL2_mixer](https://www.libsdl.org/projects/SDL_mixer/)\n\nIf you're running on Ubuntu, you can install them by running the following command:\n```sh\nsudo apt-get install -y libsdl2-dev libsdl2-2.0-0 libsdl2-image-dev libjpeg-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 libmikmod-dev libfishsound1-dev libsmpeg-dev liboggz2-dev libflac-dev libfluidsynth-dev libsdl2-mixer-dev libsdl2-mixer-2.0-0 zlib1g-dev\n```\n\n### Build\nTo build the project, navigate to the root directory and run the following command:\n```sh\ncmake -S . -B build\ncmake --build build\n```\n\n### Run\nIf the build process succeed, you can find the executable file in the `build` directory. To run the game, simply run the following command:\n```sh\n./build/Spectra\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthangisme%2Fspectra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthangisme%2Fspectra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthangisme%2Fspectra/lists"}