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

View File

@ -67,6 +67,22 @@ public class Game {
jaffa.move(direction); 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() { public void boxONeill() {
if(oneill.hasBox()) if(oneill.hasBox())
oneill.boxDrop(); oneill.boxDrop();