{"id":24493043,"url":"https://github.com/open-node/open-game","last_synced_at":"2026-04-25T18:31:26.720Z","repository":{"id":57315066,"uuid":"196911078","full_name":"open-node/open-game","owner":"open-node","description":null,"archived":false,"fork":false,"pushed_at":"2019-07-24T07:31:55.000Z","size":1206,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T20:21:11.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"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/open-node.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}},"created_at":"2019-07-15T02:38:54.000Z","updated_at":"2019-07-24T07:31:57.000Z","dependencies_parsed_at":"2022-09-12T15:02:05.802Z","dependency_job_id":null,"html_url":"https://github.com/open-node/open-game","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/open-node/open-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fopen-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fopen-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fopen-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fopen-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-node","download_url":"https://codeload.github.com/open-node/open-game/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fopen-game/sbom","scorecard":{"id":708450,"data":{"date":"2025-08-11","repo":{"name":"github.com/open-node/open-game","commit":"6e1c434ae4dce9ac139722131be5ea2e9f1a81b2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T07:26:36.533Z","repository_id":57315066,"created_at":"2025-08-22T07:26:36.533Z","updated_at":"2025-08-22T07:26:36.533Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32273209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2025-01-21T19:18:58.043Z","updated_at":"2026-04-25T18:31:26.693Z","avatar_url":"https://github.com/open-node.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open-game\n\n\u003cpre\u003enpm i open-game --save\u003c/pre\u003e\n\n# Examples\n* [Flappy bird](https://github.com/open-node/flappy-bird)\n\n\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### Table of Contents\n\n-   [Actor][1]\n    -   [Parameters][2]\n    -   [reset][3]\n    -   [update][4]\n    -   [render][5]\n    -   [aabb][6]\n        -   [Parameters][7]\n    -   [isItOn][8]\n        -   [Parameters][9]\n    -   [isOut][10]\n-   [Game][11]\n    -   [Parameters][12]\n    -   [reset][13]\n    -   [init][14]\n        -   [Parameters][15]\n    -   [progress][16]\n        -   [Parameters][17]\n    -   [loadResources][18]\n        -   [Parameters][19]\n    -   [drawImageAlignCenterByName][20]\n        -   [Parameters][21]\n    -   [drawImageByName][22]\n        -   [Parameters][23]\n    -   [registCallback][24]\n        -   [Parameters][25]\n-   [Scene][26]\n    -   [Parameters][27]\n    -   [update][28]\n    -   [render][29]\n    -   [enter][30]\n    -   [click][31]\n        -   [Parameters][32]\n\n## Actor\n\nActor 类\n\n### Parameters\n\n-   `game` **[Game][33]** 游戏实例\n-   `size`  \n\nReturns **[Actor][34]** Instance\n\n### reset\n\n重置参数值\n\nReturns **void** \n\n### update\n\n更新参数值\n\nReturns **void** \n\n### render\n\n渲染自己\n\nReturns **void** \n\n### aabb\n\n碰撞判断\n\n#### Parameters\n\n-   `x`  \n-   `y`  \n-   `w`  \n-   `h`  \n-   `target` **[Actor][34]** \n\nReturns **[boolean][35]** \n\n### isItOn\n\n给定一组 x, y判断是否在角色身上\n\n#### Parameters\n\n-   `cX`  \n-   `cY`  \n\nReturns **[boolean][35]** \n\n### isOut\n\n判断是否已经出去在画布之外\n\nReturns **[boolean][35]** \n\n## Game\n\nGame 类\n\n### Parameters\n\n-   `canvas` **[Object][36]** DOM对象，或者node.js 下 require('canvas').createCanvas()\n-   `Image` **[Function][37]** 图片构造函数，浏览器下为 window.Image, node.js 下为 require('canvas').Image\n-   `width` **[Number][38]** 期望的画布宽度，浏览器下全拼为 document.documentElement.clientWidth\n-   `height` **[Number][38]** 期望的画布高度，浏览器下全拼为 document.documentElement.clientHeight\n-   `widthRange` **\\[[Number][38]]?** 画布宽度取值范围，不设置则宽度严格等于 width\n-   `heightRange` **\\[[Number][38]]?** 画布高度取值范围，不设置则宽度严格等于 heigth\n\n### reset\n\n重置游戏参数, 例如积分\n\nReturns **void** \n\n### init\n\n初始化并开始游戏\n\n#### Parameters\n\n-   `resources` **Array.Object** 游戏所需静态资源对象 key =\u003e value 格式， key 为资源名称，value为object，格式如下\n    {\n      type: 'image', // audio, video, image\n      name: 'name', // 资源名称，预加载后会存入 this.R 方便随时获取\n      url: '[https://urladress/'][39], // 资源地址\n      map: '[https://urladress/][40]' // 图片资源对应的定位信息文件, 仅 type = image 有效\n    }\n\nReturns **void** \n\n### progress\n\n显示资源加载 loading 效果\n\n#### Parameters\n\n-   `percent`  \n-   `resources` **Array.URL** 游戏所需静态资源url列表\n\nReturns **void** \n\n### loadResources\n\n加载游戏所需静态资源\n\n#### Parameters\n\n-   `resources` **Array.Object** 游戏所需静态资源对象 key =\u003e value 格式， key 为资源名称，value为object，格式如下\n    {\n      type: 'image', // audio, video, image\n      name: 'name', // 资源名称，预加载后会存入 this.R 方便随时获取\n      url: '[https://urladress/'][39], // 资源地址\n      map: '[https://urladress/][40]' // 图片资源对应的定位信息文件, 仅 type = image 有效\n    }\n\nReturns **void** \n\n### drawImageAlignCenterByName\n\n水平居中绘制图片获取图片切片\n\n#### Parameters\n\n-   `name` **[string][41]** 图片名称\n-   `y` **[number][38]** 在画布上的y坐标\n\nReturns **void** \n\n### drawImageByName\n\n绘制图片获取图片切片\n\n#### Parameters\n\n-   `name` **[string][41]** 图片名称\n-   `x` **[number][38]** 在画布上的x坐标\n-   `y` **[number][38]** 在画布上的y坐标\n\nReturns **void** \n\n### registCallback\n\n注册帧回调函数\n\n#### Parameters\n\n-   `frames` **[number][38]** 多少帧之后\n-   `handler` **[function][37]** 执行的事件函数\n\nReturns **void** \n\n## Scene\n\nScene 类\n\n### Parameters\n\n-   `game` **[Game][33]** 游戏实例\n-   `name`  \n\nReturns **[Scene][42]** Instance\n\n### update\n\n更新各成员\n\nReturns **void** \n\n### render\n\n渲染各成员\n\nReturns **void** \n\n### enter\n\n进入场景\n\nReturns **void** \n\n### click\n\n点击事件\n\n#### Parameters\n\n-   `x`  \n-   `y`  \n\nReturns **void** \n\n[1]: #actor\n\n[2]: #parameters\n\n[3]: #reset\n\n[4]: #update\n\n[5]: #render\n\n[6]: #aabb\n\n[7]: #parameters-1\n\n[8]: #isiton\n\n[9]: #parameters-2\n\n[10]: #isout\n\n[11]: #game\n\n[12]: #parameters-3\n\n[13]: #reset-1\n\n[14]: #init\n\n[15]: #parameters-4\n\n[16]: #progress\n\n[17]: #parameters-5\n\n[18]: #loadresources\n\n[19]: #parameters-6\n\n[20]: #drawimagealigncenterbyname\n\n[21]: #parameters-7\n\n[22]: #drawimagebyname\n\n[23]: #parameters-8\n\n[24]: #registcallback\n\n[25]: #parameters-9\n\n[26]: #scene\n\n[27]: #parameters-10\n\n[28]: #update-1\n\n[29]: #render-1\n\n[30]: #enter\n\n[31]: #click\n\n[32]: #parameters-11\n\n[33]: #game\n\n[34]: #actor\n\n[35]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n\n[36]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[37]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function\n\n[38]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n[39]: https://urladress/'\n\n[40]: https://urladress/\n\n[41]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String\n\n[42]: #scene\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-node%2Fopen-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-node%2Fopen-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-node%2Fopen-game/lists"}