{"_id":"3js-game-framework","_rev":"5-6428f98225851ec295547822a758d7d0","name":"3js-game-framework","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"3js-game-framework","version":"1.0.0","keywords":["three.js","3d","game framework","game engine","3d game","game objects","animation loop","game development","game engine","javascript game","threejs","webgame","game framework"],"author":{"url":"https://upadhyaypushpendra.github.io/pushpendra.upadhyay/","name":"Pushpendra Upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"license":"MIT","_id":"3js-game-framework@1.0.0","maintainers":[{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"}],"homepage":"https://github.com/upadhyaypushpendra/3js-game-framework#readme","bugs":{"url":"https://github.com/upadhyaypushpendra/3js-game-framework/issues"},"dist":{"shasum":"59e506be2b98262b85e3cb2f05cb7086d71838d9","tarball":"https://registry.npmjs.org/3js-game-framework/-/3js-game-framework-1.0.0.tgz","fileCount":54,"integrity":"sha512-X0i7/Q73zuQTxOViiJQOdBHYbYKuf02vGC1GP3/SUaYDcewiIO9quST1qBpkLzIT/INyUeGZqjXAhlKb5akhEQ==","signatures":[{"sig":"MEQCIH9A4mY7kIwEhs2++CfOdgtXf2CAhXKLFigvyacPS+g9AiBNNg7VCYkjWr6vSn4XG9Kp32K61YpBgLPMtVniqPEYBA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68101},"main":"dist/index.js","types":"dist/types/index.d.ts","browser":"dist/index.js","gitHead":"2823031207779d5ae914243ee4ef783e30c97a70","scripts":{"dev":"tsc --watch","test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepare":"npx tsc"},"_npmUser":{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"repository":{"url":"git+https://github.com/upadhyaypushpendra/3js-game-framework.git","type":"git"},"_npmVersion":"10.8.2","description":"3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js","directories":{},"_nodeVersion":"20.19.0","dependencies":{"three":"0.174.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.8.2","@types/three":"^0.174.0"},"_npmOperationalInternal":{"tmp":"tmp/3js-game-framework_1.0.0_1743253183957_0.5422912972939524","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"3js-game-framework","version":"1.0.1","keywords":["three.js","3d","game framework","game engine","3d game","game objects","animation loop","game development","game engine","javascript game","threejs","webgame","game framework"],"author":{"url":"https://upadhyaypushpendra.github.io/pushpendra.upadhyay/","name":"Pushpendra Upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"license":"MIT","_id":"3js-game-framework@1.0.1","maintainers":[{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"}],"homepage":"https://github.com/upadhyaypushpendra/3js-game-framework#readme","bugs":{"url":"https://github.com/upadhyaypushpendra/3js-game-framework/issues"},"dist":{"shasum":"4f7037bd58ee8d3431637789a1cd9dea1ec3e998","tarball":"https://registry.npmjs.org/3js-game-framework/-/3js-game-framework-1.0.1.tgz","fileCount":54,"integrity":"sha512-BCd7UCbPwyeX+OtTdJkmkxgZPzY1NzvfdF1f/DHREp6c1VOtNwbZO1wEb28eT6Mg1o5MwIeUkSgFzsWSM+AOtw==","signatures":[{"sig":"MEQCIEs1GeezFOf3VLSEvywbzCnE6XqSaGqIRjOhOAzQeWgbAiBZCMlyR0EQcfmaw9HMCLkAJ+ARXH94LGd0oKZOjMnoYA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70469},"main":"dist/index.js","types":"dist/types/index.d.ts","browser":"dist/index.js","gitHead":"29f8ab72c94a7326e2e7f9129bf20632b7c1cd2c","scripts":{"dev":"tsc --watch","test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepare":"npx tsc"},"_npmUser":{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"repository":{"url":"git+https://github.com/upadhyaypushpendra/3js-game-framework.git","type":"git"},"_npmVersion":"10.8.2","description":"3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js","directories":{},"_nodeVersion":"20.19.0","dependencies":{"three":"0.174.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.8.2","@types/three":"^0.174.0"},"_npmOperationalInternal":{"tmp":"tmp/3js-game-framework_1.0.1_1743255224281_0.6721002556330895","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"3js-game-framework","version":"1.0.2","keywords":["three.js","3d","game framework","game engine","3d game","game objects","animation loop","game development","game engine","javascript game","threejs","webgame","game framework"],"author":{"url":"https://upadhyaypushpendra.github.io/pushpendra.upadhyay/","name":"Pushpendra Upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"license":"MIT","_id":"3js-game-framework@1.0.2","maintainers":[{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"}],"homepage":"https://github.com/upadhyaypushpendra/3js-game-framework#readme","bugs":{"url":"https://github.com/upadhyaypushpendra/3js-game-framework/issues"},"dist":{"shasum":"cf0031b4d9b314c0c6958bb7d4ca6fc77f4992b7","tarball":"https://registry.npmjs.org/3js-game-framework/-/3js-game-framework-1.0.2.tgz","fileCount":54,"integrity":"sha512-SZQaFvpf1X6SpN2Q6LJ7IwRb/biaCf7081q08dG/dsFUCYC6GOcOu5y6vQeS+jHXXgC047E6ae2MzVH0JjniPA==","signatures":[{"sig":"MEUCIQDfN5q/XyGhfgXZ+bZJLIuDFvbwYGc4BbFE4s/SAHx1PwIgLg4y0j5nqLL6SBDnMuuswBT7uSC9Uvf6isn9leS93nQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70473},"main":"dist/index.js","types":"dist/types/index.d.ts","browser":"dist/index.js","gitHead":"c876ab3bc91d965b291d0cb2af346635cebd705d","scripts":{"dev":"tsc --watch","test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepare":"npx tsc"},"_npmUser":{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"repository":{"url":"git+https://github.com/upadhyaypushpendra/3js-game-framework.git","type":"git"},"_npmVersion":"10.8.2","description":"3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.8.2","@types/three":"^0.174.0"},"peerDependencies":{"three":"0.174.0"},"_npmOperationalInternal":{"tmp":"tmp/3js-game-framework_1.0.2_1743402227382_0.17824091869131364","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"3js-game-framework","version":"2.0.0","keywords":["three.js","3d","game framework","game engine","3d game","game objects","animation loop","game development","game engine","javascript game","threejs","webgame","game framework"],"author":{"url":"https://upadhyaypushpendra.github.io/pushpendra.upadhyay/","name":"Pushpendra Upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"license":"MIT","_id":"3js-game-framework@2.0.0","maintainers":[{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"}],"homepage":"https://github.com/upadhyaypushpendra/3js-game-framework#readme","bugs":{"url":"https://github.com/upadhyaypushpendra/3js-game-framework/issues"},"dist":{"shasum":"d3f6990851bfc5038fc82696a20360ac9ae01e11","tarball":"https://registry.npmjs.org/3js-game-framework/-/3js-game-framework-2.0.0.tgz","fileCount":54,"integrity":"sha512-YJVYPB5YYC8lQtEp9fC4JFvKjQAeh+R10Bw+Fbjx01TDS8iKns268WEjxY5xdZiJ6hFa5dh2afoHu4TAUihXqA==","signatures":[{"sig":"MEUCIEPKfTNV4GjgMpNWOKFRJq5nBswy3XViSsB2URQ6pScmAiEAgWSnh/gAplc+hadT6C4DTJMFXYohVr57QRc/EVa8nuA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69650},"main":"dist/index.js","types":"dist/types/index.d.ts","browser":"dist/index.js","gitHead":"51b39c359f3ab5bd9e8cc36f863a32c220188346","scripts":{"dev":"tsc --watch","test":"echo \"Error: no test specified\" && exit 1","build":"tsc","prepare":"npx tsc"},"_npmUser":{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"repository":{"url":"git+https://github.com/upadhyaypushpendra/3js-game-framework.git","type":"git"},"_npmVersion":"10.8.2","description":"3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"5.8.2","@types/three":"^0.174.0"},"peerDependencies":{"three":"0.174.0"},"_npmOperationalInternal":{"tmp":"tmp/3js-game-framework_2.0.0_1743407450659_0.21627996290348706","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"3js-game-framework","version":"2.0.1","description":"3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js","main":"dist/index.js","browser":"dist/index.js","license":"MIT","types":"dist/types/index.d.ts","repository":{"type":"git","url":"git+https://github.com/upadhyaypushpendra/3js-game-framework.git"},"keywords":["three.js","3d","game framework","game engine","3d game","game objects","animation loop","game development","game engine","javascript game","threejs","webgame","game framework"],"author":{"name":"Pushpendra Upadhyay","email":"pushpendraupadhyay6452@gmail.com","url":"https://upadhyaypushpendra.github.io/pushpendra.upadhyay/"},"bugs":{"url":"https://github.com/upadhyaypushpendra/3js-game-framework/issues"},"homepage":"https://github.com/upadhyaypushpendra/3js-game-framework#readme","devDependencies":{"@types/three":"^0.174.0","typescript":"5.8.2"},"scripts":{"dev":"tsc --watch","build":"tsc","prepare":"npx tsc","test":"echo \"Error: no test specified\" && exit 1"},"peerDependencies":{"three":"0.174.0"},"_id":"3js-game-framework@2.0.1","gitHead":"4ade584324aca57e84d67b53034a29824d372bf1","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-o5HH3orh7wOu6nFckS9MwVLWSbTPXUbwK6fVHla2FOkLEUgWZyk8G+/ffw4nOiI2N0mG0zJoVSzuXOw3CiBIXw==","shasum":"2c719d227df1dffbe8aa4c1748552c89c2550ac0","tarball":"https://registry.npmjs.org/3js-game-framework/-/3js-game-framework-2.0.1.tgz","fileCount":54,"unpackedSize":69787,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDgXGxwhzfRso/QA1eZjoj+k1slEmh6zOoM4YKluN7uVQIhAIBYY+sq9hwNtURidbXPRl3QGpV5SzsEF+ggWCAnZBv4"}]},"_npmUser":{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"},"directories":{},"maintainers":[{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/3js-game-framework_2.0.1_1743407940082_0.4215493142752613"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-29T12:59:43.956Z","modified":"2025-03-31T07:59:00.419Z","1.0.0":"2025-03-29T12:59:44.210Z","1.0.1":"2025-03-29T13:33:44.437Z","1.0.2":"2025-03-31T06:23:47.565Z","2.0.0":"2025-03-31T07:50:50.870Z","2.0.1":"2025-03-31T07:59:00.265Z"},"bugs":{"url":"https://github.com/upadhyaypushpendra/3js-game-framework/issues"},"author":{"name":"Pushpendra Upadhyay","email":"pushpendraupadhyay6452@gmail.com","url":"https://upadhyaypushpendra.github.io/pushpendra.upadhyay/"},"license":"MIT","homepage":"https://github.com/upadhyaypushpendra/3js-game-framework#readme","keywords":["three.js","3d","game framework","game engine","3d game","game objects","animation loop","game development","game engine","javascript game","threejs","webgame","game framework"],"repository":{"type":"git","url":"git+https://github.com/upadhyaypushpendra/3js-game-framework.git"},"description":"3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js","maintainers":[{"name":"pushpendra_upadhyay","email":"pushpendraupadhyay6452@gmail.com"}],"readme":"# 3js-game-framework\r\n\r\n3js-game-framework is a lightweight and flexible framework designed to streamline the creation of 3D games and interactive applications using Three.js. It provides an easy-to-use architecture for managing game objects, updating game states, and handling the animation loop. With built-in support for object management, dynamic updates, and a clear game lifecycle, this framework helps developers focus on creating engaging 3D experiences without the boilerplate setup.\r\n\r\nKey features include:\r\n\r\n- A TJSGame class for managing the game lifecycle (start, update, end).\r\n- GameObject management with a consistent interface for custom objects.\r\n- A built-in animation loop to ensure smooth, continuous updates, which can be disabled as well.\r\n- Easy integration with Three.js for rendering 3D scenes and objects.\r\n- Simple methods to add, update, and remove game objects dynamically.\r\n- Basic extendable Game Objects like TJSBox, TJSPlane, TJSSphere.\r\n- Typescript supported\r\n\r\nWhether you're building a simple 3D game or a more complex interactive experience, 3js-game-framework provides a solid foundation to jumpstart your development.\r\n\r\n# Usage\r\n\r\n## Npm URL\r\n\r\n```cli\r\nhttps://www.npmjs.com/package/3js-game-framework\r\n```\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install 3js-game-framework\r\n```\r\n\r\n## Define your custom objects by implementing _GameObject_ Interface\r\n\r\n```javascript\r\nimport * as THREE from \"three\";\r\nimport { TJSGame, GameObject } from \"3js-game-framework\";\r\n\r\nexport class MyCustomObject extends GameObject {\r\n  game: TJSGame;\r\n  mesh: THREE.Mesh;\r\n\r\n  constructor(tjsgame: TJSGame) {\r\n    this.tjsgame = game;\r\n  }\r\n\r\n  start(tjsgame: TJSGame) {\r\n    this.game = tjsgame;\r\n    const radiusTop = 0.2;\r\n    const radiusBottom = 0.2;\r\n    const height = 0.05; // Very thin to resemble a disk\r\n    const radialSegments = 32;\r\n\r\n    const geometry = new THREE.CylinderGeometry(\r\n      radiusTop,\r\n      radiusBottom,\r\n      height,\r\n      radialSegments\r\n    );\r\n    const material = new THREE.MeshStandardMaterial({ color: 0xff0000 });\r\n    this.mesh = new THREE.Mesh(geometry, material);\r\n  }\r\n\r\n  update() {\r\n    this.mesh?.rotateZ(0.01);\r\n  }\r\n\r\n  end() {\r\n     if (this.mesh) {\r\n      this.game.scene.remove(this.mesh);\r\n      this.mesh.geometry.dispose();\r\n      if (Array.isArray(this.mesh.material)) {\r\n        this.mesh.material.forEach((material) => {\r\n          (material as THREE.Material).dispose();\r\n        });\r\n      } else {\r\n        (this.mesh.material as THREE.Material).dispose();\r\n      }\r\n    }\r\n    this.mesh = undefined;\r\n  }\r\n}\r\n\r\n```\r\n\r\n## Use the _TJSGame_ class to manage your game objects\r\n\r\n```javascript\r\nimport * as THREE from \"three\";\r\nimport { TJSGame, TJSPlane } from \"3js-game-framework\";\r\n\r\nclass Game {\r\n  tjsGame: TJSGame | null = null;\r\n\r\n  constructor() {\r\n    this.tjsGame = new TJSGame({\r\n      camera: {\r\n        position: [0, 10, 10],\r\n        enableOrbitControls: true,\r\n      },\r\n    });\r\n    this.tjsGame.camera.rotateX(-Math.PI / 4);\r\n\r\n    this.tjsGame.addGameObject(new TJSPlane(this.tjsGame));\r\n    this.tjsGame.addGameObject(new MyCustomObject(this.tjsGame));\r\n  }\r\n  start() {\r\n    console.log(\"Game started!\");\r\n    this.tjsGame?.start();\r\n  }\r\n  stop() {\r\n    console.log(\"Game stopped!\");\r\n  }\r\n  reset() {\r\n    console.log(\"Game reset!\");\r\n  }\r\n}\r\n\r\nconst game = new Game();\r\n\r\n// Start the game\r\ngame.start();\r\n```\r\n","readmeFilename":"README.md"}