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

View File

@ -1,5 +1,6 @@
package cicaprojekt; package cicaprojekt;
import java.awt.*;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -42,6 +43,18 @@ public class Control {
case 'U' : case 'U' :
game.boxJaffa(); game.boxJaffa();
break; 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(); game.updateDisplay();