{"id":18586707,"url":"https://github.com/oguzhanumutlu/physics-engine","last_synced_at":"2025-05-16T06:34:49.707Z","repository":{"id":61262181,"uuid":"549201349","full_name":"OguzhanUmutlu/physics-engine","owner":"OguzhanUmutlu","description":"Physics engine that I made with the things we learned in school","archived":false,"fork":false,"pushed_at":"2022-11-27T16:13:54.000Z","size":122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T22:04:16.691Z","etag":null,"topics":["canvas","engine","javascript","js","newton","physics","physics-engine","render","web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/OguzhanUmutlu.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}},"created_at":"2022-10-10T20:44:05.000Z","updated_at":"2023-03-16T20:58:54.000Z","dependencies_parsed_at":"2023-01-23T16:31:01.977Z","dependency_job_id":null,"html_url":"https://github.com/OguzhanUmutlu/physics-engine","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/OguzhanUmutlu%2Fphysics-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanUmutlu%2Fphysics-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanUmutlu%2Fphysics-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OguzhanUmutlu%2Fphysics-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OguzhanUmutlu","download_url":"https://codeload.github.com/OguzhanUmutlu/physics-engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254484619,"owners_count":22078755,"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":["canvas","engine","javascript","js","newton","physics","physics-engine","render","web"],"created_at":"2024-11-07T00:38:22.684Z","updated_at":"2025-05-16T06:34:49.688Z","avatar_url":"https://github.com/OguzhanUmutlu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# physics-engine\n\nPhysics engine that I made with the stuff we learned in school\n\nUsed lots of trig functions and \"Newton\"s equations\n\n[Click to view old preview](https://oguzhanumutlu.github.io/physics-engine/legacy)\n\n[Click to view new preview](https://oguzhanumutlu.github.io/physics-engine)\n\n# Preview\n\n![](./screenshots/ss.png)\n\n# Importing\n\nJust add this to your HTML to import it!\n\n```html\n\u003cscript src=\"https://unpkg.com/physics-engine\"\u003e\u003c/script\u003e\n```\n\n# Example\n\n## Add a canvas to your body, so you can use it for rendering\n\n```html\n\u003cbody\u003e\n    \u003ccanvas\u003e\u003c/canvas\u003e\n\u003c/body\u003e\n```\n\n## Initializing physics engine\n\n```html\n\u003cscript\u003e\n    window.Phygic.then(Phygic =\u003e {\n        // your code goes here!\n        console.log(\"Phygic has been loaded! \", Phygic);\n    });\n\u003c/script\u003e\n```\n\n### Or just use await it!\n\n```html\n\u003cscript type=\"module\"\u003e\n    await window.Phygic;\n    // your code goes here!\n    console.log(\"Phygic has been loaded! \", Phygic);\n\u003c/script\u003e\n```\n\n## Getting canvas\n\n```js\nconst canvas = document.querySelector(\"canvas\");\n```\n\n## Creating a physics world\n\nNote: If you don't want the renderer you don't have to enter the canvas element\n\n```js\nconst world = new Phygic.World(canvas);\n```\n\n## Rendering\n\n✨ Just run this function and done! ✨\n\n```js\nworld.createAnimators();\n```\n\n## Adding camera movement, tile dragging etc.\n\n✨ Again, just one line! ✨\n\n```js\nworld.addHelpers();\n```\n\n## Adding a box\n\n✨ Still one line! ✨\n\n```js\nnew Phygic.Tile(50, 0, world);\n```\n\n## Adding a static tile so our box doesn't fall to the nothingness\n\n✨ You get the idea everything is one line. ✨\n\n```js\nnew Phygic.Tile(50, 500, {world, isStatic: true});\n```\n\n## Final product:\n\n[Preview](https://oguzhanumutlu.github.io/physics-engine/example.html)\n\n```html\n\u003cbody\u003e\n    \u003ccanvas\u003e\u003c/canvas\u003e\n\u003c/body\u003e\n\u003cscript src=\"https://unpkg.com/physics-engine\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    window.Phygic.then(Phygic =\u003e {\n        const canvas = document.querySelector(\"canvas\");\n\n        const world = new Phygic.World(canvas);\n\n        world.createAnimators();\n\n        world.addHelpers();\n\n        new Phygic.Tile(50, 0, world);\n        \n        new Phygic.Tile(50, 500, {world, isStatic: true});\n    });\n\u003c/script\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhanumutlu%2Fphysics-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foguzhanumutlu%2Fphysics-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhanumutlu%2Fphysics-engine/lists"}