From a0f47a6e053535d337411bd68e61d53113f49820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bokros=20B=C3=A1lint?= Date: Fri, 13 May 2016 16:08:53 +0200 Subject: [PATCH] Added rotate to key options --- cicaprojekt/Control.java | 12 ++++++++++++ cicaprojekt/Game.java | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/cicaprojekt/Control.java b/cicaprojekt/Control.java index 069cb0d..bda939c 100644 --- a/cicaprojekt/Control.java +++ b/cicaprojekt/Control.java @@ -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; diff --git a/cicaprojekt/Game.java b/cicaprojekt/Game.java index a6f90e1..c47019a 100644 --- a/cicaprojekt/Game.java +++ b/cicaprojekt/Game.java @@ -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();