Add Joystick and Gamepad support

オープン
#117 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
game-dev

調査の方向性

まず、Maven のビルド設定と、プロジェクトの現在の入力またはゲームループのエントリーポイントを調べます。JInput のドキュメントとリンクされた UI の例を読んで、コントローラーのポーリングとイベント処理を理解します。プロジェクトに必要な JInput 依存関係とネイティブビルドステップが含まれ、テスト可能なユースケースにジョイスティックとゲームパッドの入力が統合されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

documentation enhancement

Support for Joystick & Gamepad

To add GamePad and Joystick support, we will use the JInput java library.

To integrate the library with Maven dependency manager :

<dependency>
    <groupId>net.java.jinput</groupId>
    <artifactId>jinput</artifactId>
    <version>2.0.9</version>
</dependency>
<dependency>
    <groupId>net.java.jinput</groupId>
    <artifactId>jinput</artifactId>
    <version>2.0.9</version>
    <classifier>natives-all</classifier>
</dependency>

Need to add the build step

    <plugin>
        <groupId>com.googlecode.mavennatives</groupId>
        <artifactId>maven-nativedependencies-plugin</artifactId>
    </plugin>

And a simple usecase from the official website :

/* Create an event object for the underlying plugin to populate */
Event event = new Event();

/* Get the available controllers */
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
for (int i = 0; i < controllers.length; i++) {
    /* Remember to poll each one */
    controllers[i].poll();

    /* Get the controllers event queue */
    EventQueue queue = controllers[i].getEventQueue();

    /* For each object in the queue */
    while (queue.getNextEvent(event)) {
        /* Get event component */
        Component comp = event.getComponent();

        /* Process event (your awesome code) */
        ...
    }
}

And a implementation usecase : UI to test JInput entries

主要言語
Java
スター
1
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mcgivrer/fromClassToGame のほかの issue

mcgivrer/fromClassToGame の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。