Package game

Class Spielfeld

All Implemented Interfaces:
_ISpielfeld, ImageObserver, MenuContainer, Serializable, Accessible

public class Spielfeld extends JPanel implements _ISpielfeld
Das gesamte Spielfeld, erstellen, loeschen von Pipes, Timer, usw.
Version:
1.0
Author:
Daniel Hamm
See Also:
Serialized Form
  • Constructor Details

    • Spielfeld

      public Spielfeld(int difficulty)
      Create the panel.
  • Method Details

    • getLevels

      public String[] getLevels()
      Specified by:
      getLevels in interface _ISpielfeld
      Returns:
      die Konfiguration zur Erstellung der Level
    • won

      public void won()
      Description copied from interface: _ISpielfeld
      Wird ausgefuehrt, wenn das Spiel gewonnen wurde Das naechste Level wird gestartet
      Specified by:
      won in interface _ISpielfeld
    • start

      public void start()
      Description copied from interface: _ISpielfeld
      startet den Timer, um die Zeit ablaufen zu lassen
      Specified by:
      start in interface _ISpielfeld
    • getSolution

      public String[] getSolution()
      Specified by:
      getSolution in interface _ISpielfeld
      Returns:
      die Loesungen der Level
    • getPath

      public String getPath()
      Specified by:
      getPath in interface _ISpielfeld
      Returns:
      die momentane Konfiguration der Rohre
    • waterFlows

      public void waterFlows()
      Description copied from interface: _ISpielfeld
      Sobald der Timer abgelaufen ist, wird diese Methode ausgefuehrt Ueberprueft, ob die momentane Konfiguration dieselbe ist, wie die Loesung
      Specified by:
      waterFlows in interface _ISpielfeld
    • lost

      public void lost()
      Description copied from interface: _ISpielfeld
      Wird ausgefuehrt, wenn das Spiel verloren wurde Oeffnet ein JOptionPane bevor das Spiel beendet wird
      Specified by:
      lost in interface _ISpielfeld
    • removePipes

      public void removePipes()
      Description copied from interface: _ISpielfeld
      Loescht alle Rohre, die momentan am Bildschirm sind
      Specified by:
      removePipes in interface _ISpielfeld
    • createPipes

      public void createPipes()
      Description copied from interface: _ISpielfeld
      Erstellt die Pipes, nach der Vorgabe in Levels.txt
      Specified by:
      createPipes in interface _ISpielfeld
    • getLevel

      public int getLevel()
      Returns:
      Auf welchem Level der Spieler ist
    • getPoints

      public int getPoints()
      Returns:
      Anzahl der Punkte