Added keyboard input support for shooting stargates

This commit is contained in:
Bokros Bálint 2016-05-07 17:44:20 +02:00
parent a7d6c604d8
commit 1c4488d710
1 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package cicaprojekt;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
@ -42,6 +43,18 @@ public class Control {
case 'U' :
game.boxJaffa();
break;
case 'E' :
game.shootStargate(Color.YELLOW);
break;
case 'R' :
game.shootStargate(Color.BLUE);
break;
case 'O' :
game.shootStargate(Color.RED);
break;
case 'P' :
game.shootStargate(Color.GREEN);
break;
}
game.updateDisplay();