net.java.games.input.test.RumbleTest Maven / Gradle / Ivy
The newest version!
/*
* RumbleTest.java
*
* Created on 01 December 2003, 23:02
*/
package net.java.games.input.test;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.Controller;
import net.java.games.input.Rumbler;
import net.java.games.input.Version;
/**
*
* @author Jeremy
*/
public class RumbleTest {
/** Creates a new instance of RumbleTest */
public RumbleTest() {
ControllerEnvironment ca = ControllerEnvironment.getDefaultEnvironment();
System.out.println("JInput version: " + Version.getVersion());
Controller[] controllers = ca.getControllers();
for(int i=0;i-1.0f;) {
long startTime = System.currentTimeMillis();
rumblers[j].rumble(k);
try {
Thread.sleep(1);
} catch (InterruptedException e) {
}
k-=((float)(System.currentTimeMillis() - startTime))/1000f;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
System.out.println("Rumbling with intensity: " + 0.0f);
rumblers[j].rumble(0f);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
}
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
new RumbleTest();
}
}