Coder Social home page Coder Social logo

gamecenter's Introduction

GameCenter is an IDEA Plugin for Developer to play Games

platforms tools licence downloads version

插件使用

GameCenter:支持IDEA中展示游戏菜单
插件安装:插件已上传官方Plugins仓库,可搜索 GameCenter 下载
使用文档:点击跳转

项目说明

为了缓解日复一日枯燥编程带来了的压力,由此Game Center插件诞生。Game Center顾名思义,是在IDEA中集成一个游戏菜单,方便开发同学工作之余使用。

使用截图

plugin display

游戏列表

按键 player1 player2
Left A
Right D
Up W
Down S
B J Num-1
A K Num-2
Start Enter Num-8
Select Tab Num-7

重点说明

如果当前IDEA支持 JCEF ,FC游戏会在IDEA中直接打开,否则只能借助系统浏览器运行。 默认情况下,Intellij IDEA 支持JCEF的,而AndroidStudio 不支持,如果想要打开IDEA的JCEF功能,请参考文档 如何打开JCEF?


插件扩展

考虑该插件的扩展性,降低后期的开发成本,方便更多的游戏集成。Game Center 支持将每一个游戏以 jar 文件的形式进行引入。

开发环境要求

  • java 11

开发步骤

  • 1、编写Swing游戏
  • 2、引用 GameCenterBase.jar依赖(可选)
GameCenterBase 依赖包,提供音频播放、数据存储功能:

数据存储:

GameCenterFacade<? extends GameCenterService> gameCenterFacade = GameCenterFacade.getInstance();
StorageService storageService = gameCenterFacade.getStorageService();
storageService.save(key,value) / storageService.read(key)

音频播放:

GameCenterFacade<?> gameCenterFacade = GameCenterFacade.getInstance();
AudioService audioService = gameCenterFacade.getAudioService();
InputStream audioStream = getResourceAsStream(assetPath);
audioService.play(audioStream);
  • 3、为Swing游戏添加指定入口函数,以便 Game Center 能运行该游戏

    public static void runGame() {
      ...
    }
    
  • 4、将编写的Swing游戏导出成jar文件

  • 5、注入游戏到 Game Center IDEA插件

    • 将第4步生成的jar,放入项目根目录的libs文件夹
    • src/main/resources/game/swing/conf.properties 中配置游戏,格式如下:
    Game Name=runGame 函数所在的类的FQN,例如:FlyBird=com.kingyu.flappybird.app.App
    
  • 6、将Swing游戏的源代码,放入到 game-list 中(可选)

  • 7、提交PR,游戏运行无误,即可发布上市场

gamecenter's People

Contributors

actions-user avatar yanglang116 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.