{"id":26334397,"url":"https://github.com/yanglang116/gamecenter","last_synced_at":"2025-03-16T00:18:47.091Z","repository":{"id":150857215,"uuid":"496904875","full_name":"YangLang116/GameCenter","owner":"YangLang116","description":"GameCenter is an IDEA Plugin for Developer to play Games","archived":false,"fork":false,"pushed_at":"2024-10-24T13:28:07.000Z","size":8482,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-25T16:00:03.954Z","etag":null,"topics":["android-studio","game","idea-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jetbrains.com/plugin/19259-gamecenter","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YangLang116.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2022-05-27T07:43:11.000Z","updated_at":"2024-10-24T13:28:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"1296204c-67eb-43b2-aa96-f4ccc90441a5","html_url":"https://github.com/YangLang116/GameCenter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":"JetBrains/intellij-platform-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YangLang116%2FGameCenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YangLang116%2FGameCenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YangLang116%2FGameCenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YangLang116%2FGameCenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YangLang116","download_url":"https://codeload.github.com/YangLang116/GameCenter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806528,"owners_count":20350858,"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":["android-studio","game","idea-plugin"],"created_at":"2025-03-16T00:18:46.410Z","updated_at":"2025-03-16T00:18:47.086Z","avatar_url":"https://github.com/YangLang116.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Plugin description --\u003e\nGameCenter is an IDEA Plugin for Developer to play Games\n\u003c!-- Plugin description end --\u003e\n\n![platforms](https://img.shields.io/badge/platforms-macos%20%7C%20windows%20%7C%20linux-blue) ![tools](https://img.shields.io/badge/idea-intellij_IDEA%20%7C%20AndroidStudio-blue) ![licence](https://img.shields.io/badge/licence-MIT-blue) ![version](https://img.shields.io/badge/version-v1.0.1-blue)\n\n## 项目说明\n\n为了缓解日复一日枯燥编程带来了的压力，由此`Game Center`插件诞生。`Game Center`顾名思义，是在`IDEA`中集成一个游戏菜单，方便开发同学工作之余使用。\n\n## 使用截图\n\n![plugin display](../../configs/game_display.png)\n\n## 游戏列表\n\n- FlappyBird - 从项目 [FlappyBird](https://github.com/kingyuluk/FlappyBird) 进行移植\n\n- FC游戏 - [游戏清单](https://github.com/YangLang116/nes-game-list) 按键说明如下：\n\n| 按键 | player1 | player2 |\n| :----: | :----: | :----: |  \n| Left | A | ← |  \n| Right | D |→ |  \n| Up | W | ↑ |\n| Down | S | ↓ |  \n| B | J | Num-1 |  \n| A | K | Num-2 |\n| Start |\tEnter |\tNum-8 |\n| Select | Tab |\tNum-7 |\n\n## 重点说明\n\n### JCEF\n如果当前IDEA支持 [JCEF](https://plugins.jetbrains.com/docs/intellij/jcef.html) ，FC游戏会在IDEA中直接打开，否则只能借助系统浏览器运行。 默认情况下，Intellij IDEA 支持JCEF的，而AndroidStudio 不支持，如果想要打开IDEA的JCEF功能，请参考文档 [如何打开JCEF?](https://www.jianshu.com/p/68056562d1c4)\n\n### 游戏乱码\n点击主菜单栏 `Help` \u003e `Edit Custom VM Options` 入口，并在弹窗中添加以下配置：\n```\n-Dfile.encoding=UTF-8\n```\n\n---\n\n## 插件扩展\n\n考虑该插件的扩展性，降低后期的开发成本，方便更多的游戏集成。`Game Center` 支持将每一个游戏以 `jar` 文件的形式进行引入。\n\n### 开发环境要求\n\n- java 17\n\n### 开发步骤\n\n- 1、编写Swing游戏\n- 2、引用 `GameCenterBase.jar`依赖(可选)\n\n```\nGameCenterBase 依赖包，提供音频播放、数据存储功能：\n\n数据存储：\n\nGameCenterFacade\u003c? extends GameCenterService\u003e gameCenterFacade = GameCenterFacade.getInstance();\nStorageService storageService = gameCenterFacade.getStorageService();\nstorageService.save(key,value) / storageService.read(key)\n\n音频播放：\n\nGameCenterFacade\u003c?\u003e gameCenterFacade = GameCenterFacade.getInstance();\nAudioService audioService = gameCenterFacade.getAudioService();\nInputStream audioStream = getResourceAsStream(assetPath);\naudioService.play(audioStream);\n```\n\n- 3、为Swing游戏添加指定入口函数，以便 `Game Center` 能运行该游戏\n    ```\n    public static void runGame() {\n      ...\n    }\n    ```\n\n- 4、将编写的Swing游戏导出成jar文件\n\n- 5、注入游戏到 `Game Center` IDEA插件\n  - 将第4步生成的jar，放入项目根目录的`libs`文件夹\n  - 在`src/main/resources/game/swing/conf.properties` 中配置游戏，格式如下：\n\n  ```\n  Game Name=runGame 函数所在的类的FQN，例如：FlyBird=com.kingyu.flappybird.app.App\n  ```\n\n- 6、将Swing游戏的源代码，放入到 `game-list` 中(可选)\n\n- 7、提交PR，游戏运行无误，即可发布上市场\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanglang116%2Fgamecenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanglang116%2Fgamecenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanglang116%2Fgamecenter/lists"}