From bef28b854db2e9b6a432f7c392b3d88fd2ea3f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Tue, 22 May 2012 23:35:52 +0200 Subject: [PATCH] bauen bauen bauen --- src/de/ctdo/crashtest/Statemachine.java | 10 ++++++++-- src/de/ctdo/crashtest/SteuerungFrame.java | 13 ++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/de/ctdo/crashtest/Statemachine.java b/src/de/ctdo/crashtest/Statemachine.java index ddf8300..ff7137f 100644 --- a/src/de/ctdo/crashtest/Statemachine.java +++ b/src/de/ctdo/crashtest/Statemachine.java @@ -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 stateChangeListenerList = new ArrayList(); 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; + } } diff --git a/src/de/ctdo/crashtest/SteuerungFrame.java b/src/de/ctdo/crashtest/SteuerungFrame.java index 6c0062d..452ddec 100644 --- a/src/de/ctdo/crashtest/SteuerungFrame.java +++ b/src/de/ctdo/crashtest/SteuerungFrame.java @@ -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; }