Added rotate to key options

This commit is contained in:
Bokros Bálint 2016-05-13 16:08:53 +02:00
parent c9ec85cec5
commit a0f47a6e05
2 changed files with 28 additions and 0 deletions

View File

@ -23,6 +23,12 @@ public class Control {
case 'D' :
Game.instance.moveONeill(Direction.EAST);
break;
case 'Y' :
Game.instance.rotateOneillLeft();
break;
case 'X' :
Game.instance.rotateOneillRight();
break;
case 'I' :
Game.instance.moveJaffa(Direction.NORTH);
break;
@ -35,6 +41,12 @@ public class Control {
case 'L' :
Game.instance.moveJaffa(Direction.EAST);
break;
case 'M' :
Game.instance.rotateJaffaLeft();
break;
case ',' :
Game.instance.rotateJaffaRight();
break;
case 'Q' :
Game.instance.boxONeill();
break;

View File

@ -67,6 +67,22 @@ public class Game {
jaffa.move(direction);
}
public void rotateOneillLeft() {
oneill.rotateLeft();
}
public void rotateOneillRight() {
oneill.rotateRight();
}
public void rotateJaffaLeft() {
jaffa.rotateLeft();
}
public void rotateJaffaRight() {
jaffa.rotateRight();
}
public void boxONeill() {
if(oneill.hasBox())
oneill.boxDrop();