{"id":16229110,"url":"https://github.com/doughtnerd/tranquilityengine","last_synced_at":"2026-01-15T22:14:54.226Z","repository":{"id":39141360,"uuid":"259832333","full_name":"doughtnerd/TranquilityEngine","owner":"doughtnerd","description":"Pure javascript game engine with major inspiration from Unity Game Engine.","archived":false,"fork":false,"pushed_at":"2023-01-13T01:55:47.000Z","size":31898,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T12:49:36.994Z","etag":null,"topics":["game-development","game-engine","gamedev","physics-engine","unity","unity3d","webgl"],"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/doughtnerd.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":"2020-04-29T05:25:08.000Z","updated_at":"2021-04-26T19:55:11.000Z","dependencies_parsed_at":"2023-02-09T14:15:48.441Z","dependency_job_id":null,"html_url":"https://github.com/doughtnerd/TranquilityEngine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doughtnerd/TranquilityEngine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2FTranquilityEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2FTranquilityEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2FTranquilityEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2FTranquilityEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doughtnerd","download_url":"https://codeload.github.com/doughtnerd/TranquilityEngine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2FTranquilityEngine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["game-development","game-engine","gamedev","physics-engine","unity","unity3d","webgl"],"created_at":"2024-10-10T12:57:24.163Z","updated_at":"2026-01-15T22:14:54.209Z","avatar_url":"https://github.com/doughtnerd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TranquilityEngine\n\n## What is it?\nA JavaScript based 2D/3D game engine based on the Unity Game Engine.\n\n## Why is it?\nI've taken a look at the JS based game engine landscape and of them, the only one I'm impressed with is PhaserJS. With PhaserJS, they've done a lot of work to make building a game as simple as possible for new \u0026 advanced users. Most of the other engines that exist are overly complicated or didn't have a huge focus on being a 'Game Engine'. So, with my experience working with game engines I decided to make a fusion of JS and Unity. Unity in my opinion is one of the most accessible production grade engines out there to date and that's what I hope this engine will be one day too. My hope is that once this engine is complete enough, JS developers will be able to Zen-out and build a game while learning some of the core APIs that power Unity. \n## Limitations\nThis project is in active development and as such, might not have every feature 100% complete. It is also currently limited to WebGL for rendering. Lastly, this documentation will change as new features become complete and may not always reflect the current state of the engine.\n\n## Quick Demo\n![Basic Demo](./demo/BasicDemo.gif)\nTo see a very basic example of the game engine operating run:\n```shell\nnpm run start\n```\n## Current Features\nAgain, these might be subject to change throughout development but the features that currently exist are described below.\n\n## 2D \u0026 3D Camera\nThe Game Engine's camera is built to be usable for both 2D perspective \u0026 orthographic games as well as full 3D games. Here's an example of the 3D Camera at work with the flappy bird example:\n\n![3D Camera Demo](./demo/3DCameraDemo.gif)\n\n\n### Custom rendering \nAllows for custom shaders to be developed and used in the project through the use of material and shader files like so:\n\n![Shader Usage](./demo/ShaderUsage.gif)\n\n### GameObjects\nLike unity, everything that exists in a game scene is a GameObject. Each GameObject can have a number of scripts attached to it called GameBehaviors.\nThe basic skeleton for a GameObject class is the following:\n\n#### PlayerObject.js\n```JavaScript\nimport GameObject from \"../../engine/GameObject\";\n\nexport default class PlayerObject extends GameObject {\n  constructor(name = \"Player\") {\n    super(name);\n    // Game Behaviors can be attached below\n  }\n}\n\n```\n\n### GameBehavior Based Scripting\nJust like Unity, this game engine uses Behaviors that attach to your GameObjects but instead of being called MonoBehaviours, these kinds of scripts are called GameBehaviors. \n\nGameBehaviors have lifecycle hooks that can be used to bring your script to life. A basic GameBehavior script might look like the following:\n\n```JavaScript\nimport GameBehavior from \"../../engine/GameBehavior\";\nimport Time from \"../../engine/Time\";\nimport Damageable from \"./Damageable\";\n\nexport default class DropItemOnDeath extends GameBehavior {\n  item;\n\n  awake() {\n    this.gameObject.getBehavior(Damageable).eventEmitter.addListener(\"Died\", this.dropItem.bind(this));\n  }\n\n  update() {\n    // Do something every frame if you want\n  }\n\n  onDestroy() {\n    this.gameObject.getBehavior(Damageable).eventEmitter.removeListener(this.dropItem.bind(this));\n  }\n\n  dropItem() {\n    console.debug(`${this.gameObject.name} Dropped: ${this.item}`);\n  }\n}\n```\n\n### Scene Serialization and Loading\nMuch like any game engine, you can divide your game up into scenes and load them using the SceneManager class.\n\n```JavaScript\nimport SceneManager from \"./engine/SceneManager\";\nimport scene1 from './assets/scenes/scene1.js'\n\nSceneManager.scenes = [scene1];\n\nSceneManager.eventEmitter.on(\"sceneLoading\", (data: { progress: any }) =\u003e {\n  console.debug(\"Scene Load Progress: \", data.progress);\n});\n\nSceneManager.loadScene(0);\n```\n\nScene files themselves currently are js files with json objects that configure the objects your scene might have and any adjustments to default settings.\n\n```Javascript\nconst cameraObj = {\n  sceneId: 0,\n  type: CameraObject,\n  behaviors: {\n    Transform: {\n      attributes: {\n        position: new Vector3(0, 0, -10),\n      },\n    },\n    Camera: {\n      attributes: {\n        fieldOfView: 90,\n        targetDisplayIndex: 0,\n        projection: \"orthographic\",\n      },\n    },\n  },\n};\n\nconst playerObj = {\n  sceneId: 1,\n  type: PlayerObject,\n  attributes: {\n    name: \"Player\",\n    tags: [\"Player\"],\n  },\n  behaviors: {\n    Transform: {\n      attributes: {\n        position: new Vector3(-2, 2, 0),\n        scale: new Vector3(2, 2, 1),\n      },\n    },\n  },\n};\n\nmodule.exports = {\n  gameObjects: [cameraObj, playerObj],\n};\n```\n\n### Custom RigidBody Physics \u0026 Collisions\n\nThe engine currently features a limited set of RigidBody physics and collisions. \nCurrent functionality includes:\n\n- Impulse, normal, and gravity forces on rigidbodies.\n- Sweep \u0026 Prune based collision detection.\n- Box Collider for collision Detection.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoughtnerd%2Ftranquilityengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoughtnerd%2Ftranquilityengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoughtnerd%2Ftranquilityengine/lists"}