{"id":26504647,"url":"https://github.com/lbirkert/oscsim","last_synced_at":"2026-05-21T14:04:17.644Z","repository":{"id":251330039,"uuid":"837088482","full_name":"lbirkert/oscsim","owner":"lbirkert","description":"A physics based simulation game about oscilating things.","archived":false,"fork":false,"pushed_at":"2024-08-16T21:01:11.000Z","size":9559,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-16T22:20:43.147Z","etag":null,"topics":["physics","python","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","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/lbirkert.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":"2024-08-02T07:28:43.000Z","updated_at":"2024-08-16T22:20:44.996Z","dependencies_parsed_at":"2024-08-08T22:31:05.283Z","dependency_job_id":null,"html_url":"https://github.com/lbirkert/oscsim","commit_stats":null,"previous_names":["lbirkert/oscsim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Foscsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Foscsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Foscsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Foscsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbirkert","download_url":"https://codeload.github.com/lbirkert/oscsim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244683330,"owners_count":20493166,"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":["physics","python","simulation"],"created_at":"2025-03-20T20:12:36.764Z","updated_at":"2026-05-21T14:04:12.618Z","avatar_url":"https://github.com/lbirkert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## oscsim\n\nA physics based simulation game to play around with\noscillating things written in Python.\n\n[view the demo](https://github.com/lbirkert/oscsim/raw/main/demo.mp4)\n\n----\n\n### Quickstart\n\n0. (optional) setup python venv\n```\n$ python3 -m venv .venv\n```\n**Please use .venv/bin/python3 as \u003cpath/to/python3\u003e if you choose to go with this route!**\n\n1. Install the required dependencies\n```\n$ \u003cpath/to/python3\u003e -m pip install -r requirements.txt\n```\n\n2. Launch the application\n```\n$ \u003cpath/to/python3\u003e src/main.py\n```\n\n### Hacking Guide\n\n#### Adding your own springs\n\n`src/sim.py`\n```py\nclass YourSpring(Spring):\n    def __init__(self, stiffness: float = 10, **kwargs):\n        super().__init__(**kwargs)\n        self.stiffness = stiffness\n\n    def magnitude(self, dist: float) -\u003e float:\n        # return the magnitude of the force, which the spring applies\n        # if this is negative, the spring will push outwards instead of pull\n        return math.exp(dist) / (dist ** 2) * self.stiffness\n```\n\n`src/main.py`\n```py\nsprings = [\n    (\"constant\", ConstantSpring),\n    (\"proportional\", HookesSpring),\n    (\"quadratic\", QuadraticSpring),\n    (\"hyperbolic\", HyperbolicSpring),\n    # we can use the hyperbolic spring's icon for now\n    (\"hyperbolic\", YourSpring),\n]\n```\n\nNow you can try it out and see how it behaves.\n\n#### Custom icons\n\nPaste `your_icon.png` into `imgs/`.\n\n`src/main.py`\n```py\nsprings = [\n    (\"constant\", ConstantSpring),\n    (\"proportional\", HookesSpring),\n    (\"quadratic\", QuadraticSpring),\n    (\"hyperbolic\", HyperbolicSpring),\n    (\"your_icon.png\", YourSpring),\n]\n```\n\n### Controls\n\n#### Adding anchors\n\nPro-Tip: disable gravity or pause the simulation (space key) for easier handling of anchors\n\nHold and drag from the anchor icon on the bottom right corner\nto spawn a new anchor at your cursor, which you can then drag around the scene.\n\nSelect at least two anchors and click on one of the spring icons in the bottom right\ncorner to connect these anchors with the given spring type.\n\nkey|function\n--|--\nspace|show/hide settings menu\nspace|pause/resume simulation\nright mouse button|navigate around the scene\nright mouse button|select anchor\nright mouse button|move anchor\nright mouse button|end selection\nshift|extend selection\nbackspace|delete selected\nscroll wheel|zoom in/out\n\n\n----\n\n\u0026copy; 2024 Lucas Birkert - All Rights Reserved\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbirkert%2Foscsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbirkert%2Foscsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbirkert%2Foscsim/lists"}