{"id":15047820,"url":"https://github.com/ninivert/swing-bye-py","last_synced_at":"2026-02-01T03:35:40.390Z","repository":{"id":128920163,"uuid":"389106136","full_name":"ninivert/Swing-bye-py","owner":"ninivert","description":"A game about learning to use swing-by manoeuvres to get to a target","archived":false,"fork":false,"pushed_at":"2023-07-02T18:18:34.000Z","size":13906,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T17:17:21.259Z","etag":null,"topics":["cplusplus-11","game","pyglet","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"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/ninivert.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":"2021-07-24T13:30:48.000Z","updated_at":"2022-05-21T20:52:46.000Z","dependencies_parsed_at":"2024-09-29T00:01:09.934Z","dependency_job_id":"61f8ae79-3c7a-4dfc-99ab-7c85cd2f665c","html_url":"https://github.com/ninivert/Swing-bye-py","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/ninivert%2FSwing-bye-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninivert%2FSwing-bye-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninivert%2FSwing-bye-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninivert%2FSwing-bye-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninivert","download_url":"https://codeload.github.com/ninivert/Swing-bye-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243489778,"owners_count":20298997,"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":["cplusplus-11","game","pyglet","python"],"created_at":"2024-09-24T21:04:59.344Z","updated_at":"2026-02-01T03:35:40.355Z","avatar_url":"https://github.com/ninivert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swing-bye-py\n\nSwing-bye is a game about learning to use swing-by manoeuvres to get to a target, that would otherwise be impossible to reach.\n\nThe state of the project is still a work in progress, with only the core gameplay mechanics and UI implemented.\n\nTo help the player, a little graph at the bottom left of the screen shows the evolution of the ship's energy :\n- Orange line : kinetic energy T\n- Blue line : potential energy U\n- Black line : total energy E = T + U\n\nIf the swing-by manoeuvre is performed correctly, the player will see an uptick in the total energy of the ship.\n\n![graph](media/graph.png)\n\n## Screenshots and demo videos\n\n![home](media/swingbye_home.png)\n\n[Gameplay demo video ![gameplay](media/swingbye_gameplay_ui.png)](https://youtu.be/W0BZIy1AJp0)\n\n[Editor demo video ![editor](media/swingbye_editor_ui.png)](https://youtu.be/5UufhV83C3w)\n\n## Controls\n\nPress `0` to focus on the target, `1` to focus on the ship, any other number key to lose focus.\n\nPan and scroll with mouse to control camera position and zoom.\n\nUse the time slider to adjust launch date, and once launched, the speed of the game can also be changed.\n\n![annotated ui](media/swingbye_ui_annotated.png)\n\n## Simulation notes\n\nThe physics engine is written in C++, and compiled to a Python module using `pybind11`.\n\nPlanet positions are computed by numerically solving Euler's equation (see [planet.hpp](swingbye/cphysics/src/planet.hpp)). This allows to explicitly adapting the orbit paramters (eccentricity, major axis, inclination, etc.), and being able to exactly compute the positions at any time.\n\nAfter launch, the ship is simulated by solving Newton's second law numerically, using a Runge-Kutta integrator of order 4 (see [integrator.hpp](swingbye/cphysics/src/integrator.hpp))\n\n## How to compile and run\n\n1. Install the Python dependencies : `pip install -r requirements.txt`\n2. Compile the `cphysics` submodule : `make build-cphysics`. This required having the `smart_holder` branch of `pybind11`, which can be installed by running `make install-pybind-smart_holder`\n3. Run the game : `python -m swingbye`\n\n## TODO\n\nRendering\n\n- [X] Fix background parallax on resize\n- [X] Create Background class to hold all stars and background image\n- [ ] Give each level a seed to keep the background consistant\n- [X] Fix weird glitch with hiding / unhiding Graph (becomes blocky for some reason?)\n- [ ] Planet / comet labels\n- [X] Texture comets\n- [X] FIX THE GODDAMN CAMERA (Y A T T A)\n- [X] KE and PE graphs\n- [ ] Find out why button text sometimes appears bellow the button\n\nCode structure and stuff\n\n- [ ] Correctly dispose of useless sprites / paths\n- [ ] Combine WorldState and GameState\n\nUI\n\n- [ ] Make it not ugly\n- [ ] Custom main menu w/ animations?\n- [ ] Make options actually do something\n- [ ] Make level selection work\n\nPhysics\n\n- [X] Ship prediction\n- [X] Orbit lines\n- [X] KE and PE\n- [X] optimize physics in c++\n\nGame\n\n- [ ] State management (reset, next level, etc)\n- [ ] Make more levels\n- [ ] Animations on level entry (e.g. zoom in, time autoscroll, cutscene????)\n- [ ] Add the goal (black hole?) to the levels\n- [ ] Integrate easter eggs\n- [ ] Make ship hitbox smaller than sprite\n- [X] Make functional level editor\n- [X] Allow for exporting worlds from the editor\n- [ ] Allow to add ship in editor\n\nStructure\n\n- [ ] use git submodules for the pybind11-smart_holder dependency\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninivert%2Fswing-bye-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninivert%2Fswing-bye-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninivert%2Fswing-bye-py/lists"}