bauen bauen bauen

This commit is contained in:
Lucas Pleß 2012-05-22 23:35:52 +02:00
parent a80cf9177e
commit bef28b854d
2 changed files with 20 additions and 3 deletions

View File

@ -9,6 +9,7 @@ public class Statemachine {
private final char TABLE_ONE = 'G';
private final char TABLE_TWO = 'H';
private final char TABLE_THREE = 'I';
private final char ROKET_INPUT = 'B';
private long lastHandleInput = 0;
private final List<StateChangeListener> stateChangeListenerList = new ArrayList<StateChangeListener>();
private int stateChangeCounter = 0;
@ -27,7 +28,8 @@ public class Statemachine {
TABLE_GAME_FIVE,
TABLE_GAME_SIX,
TABLE_GAME_SEVEN,
FINISH,
TABLE_FINISH,
ROKET_DONE
}
private state currentState = state.IDLE;
@ -154,9 +156,13 @@ public class Statemachine {
break;
case TABLE_GAME_SEVEN:
if(input == BLUE_BUTTON) {
retVal = state.FINISH;
retVal = state.TABLE_FINISH;
}
break;
case TABLE_FINISH:
if(input == ROKET_INPUT) {
retVal = state.ROKET_DONE;
}
}

View File

@ -94,6 +94,9 @@ public class SteuerungFrame extends JFrame implements StateChangeListener {
case ENTERED_ROOM:
bunti.setLampel(false,false,false);
setLEDs(255,0,100);
// start von Mo Do - Eins, Zwei Polizei
break;
case TABLE_GAME_ONE:
bunti.setLampel(true,false,false);
@ -106,6 +109,10 @@ public class SteuerungFrame extends JFrame implements StateChangeListener {
case TABLE_GAME_THREE:
bunti.setLampel(false,true,false);
setLEDs(255,35,0);
break;
case TABLE_GAME_FOUR:
bunti.setLampel(false,true,false);
@ -123,9 +130,13 @@ public class SteuerungFrame extends JFrame implements StateChangeListener {
bunti.setLampel(false,false,true);
setLEDs(255,100,0);
break;
case FINISH:
case TABLE_FINISH: // und roket muss starten
bunti.setLampel(false,false,true);
setLEDs(0, 255, 0);
break;
case ROKET_DONE:
break;
}