colorbox/Controller
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
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