mcgivrer / mcgivrer/fromClassToGame
Add Joystick and Gamepad support
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the Maven build configuration and the project's current input or game-loop entry points. Read the JInput documentation and the linked UI example to understand controller polling and event handling. Done means the project includes the required JInput dependencies and native build step, with joystick and gamepad input integrated in a testable use case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100