colorbox / Controller

gaming controller for java applet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This Module is gaming controller for javaaplet.

Stick express 8 directions stick.
Button express 1 button.

usage:

Controller variable needs to execute incrementTime() method in game loop.



example:

while(){

	.
	.
	.

	gaming loop and operation
	if(Controller.getStickDirection()==8){
		Character.jump();
	}

	if(Controller.isZPress()){
		Character.attack();
	}

	.
	.
	.
	Controller.incrementTime();


}

keyPressed(KeyEvent e){
	Controller.keyPressed(e);
}
keyReleased(KeyEvent e){
	Controller.keyReleased(e);
}


/*
note isPress method in the Button recomended to use one time per loop
because Button memoried last press time in isPress method
*/
----------
Test
java org.junit.runner.JUnitCore Controller.TestXXX


About

gaming controller for java applet


Languages

Language:Java 100.0%