Package oop13.space.testing.TestCollisionsInFrame

Examples of oop13.space.testing.TestCollisionsInFrame.Control


  @Override
  public void seeAchievementsCmd() {
    ListIOManager<Achievement> achManager = new ListIOManager<Achievement>(this.model.getAchievementsFile());
    this.model.initAchievements();
    List<Achievement> listAchievements = achManager.readList();
    AchievementsGUI achievementsGUI = new AchievementsGUI(listAchievements);
    AchievementsController achController = new AchievementsController(this.mainFrame, this.model);
    achController.setView(achievementsGUI);
    this.mainFrame.replacePanel(achievementsGUI);
  }
View Full Code Here


  }


  @Override
  public void seeCreditsCmd() {
    Credits credits = new Credits();
    CreditsController creditsController = new CreditsController(this.mainFrame);
    creditsController.setView(credits);
    this.mainFrame.replacePanel(credits);
  }
View Full Code Here

    this.gamePanel.gameChanged();
  }

  @Override
  public void gameOver() {
    GameOver gameOverGUI = new GameOver();
    GameOverController gameOverController = new GameOverController(this.mainFrame, this.model);
    gameOverController.setView(gameOverGUI);
    this.mainFrame.replacePanel(gameOverGUI);
  }
View Full Code Here

    this.mainFrame.replacePanel(gamePanel);
  }

  @Override
  public void endGame() {
    GameOver gameOver = new GameOver();
    GameOverController gameOverController = new GameOverController(this.mainFrame, this.model);
    gameOverController.setView(gameOver);
    this.mainFrame.replacePanel(gameOver);
  }
View Full Code Here

    this.model.resetGame();
    this.model.getShip().setLives(oldLives);
    this.model.getShip().increaseLives();
    this.model.initIndividuals();
    GameController gameController = new GameController(this.mainFrame, this.model);
    GamePanel gamePanel = new GamePanel(this.model.getList());
    gamePanel.getScoreLabel().setText(GameStrings.SCORE + model.getStatistics().getScore());
    gamePanel.getLivesLabel().setText(GameStrings.LIVES + model.getShip().getLives());
    gameController.setView(gamePanel);
    gamePanel.requestFocusInWindow();
    gamePanel.addKeyListener(new ShipController(this.model));
    this.mainFrame.replacePanel(gamePanel);
  }
View Full Code Here

  //Creates new TestCollisionsToShip
  public TestCollisionsToShip() {
    this.listIndividuals = new CopyOnWriteArrayList<>();
    this.spaceShip = new ShipTest();
    this.listIndividuals.add(this.spaceShip);
    this.testPanel = new GamePanel(this.listIndividuals);
    this.testPanel.addKeyListener(new Control(this.listIndividuals));
    this.testPanel.setFocusable(true);
  }
View Full Code Here

  public void playAgain() {
    this.model.resetGame();
    this.model.getStatistics().resetStatistics();
    this.model.initIndividuals();
    GameController gameController = new GameController(this.mainFrame, this.model);
    GamePanel gamePanel = new GamePanel(this.model.getList());
    gamePanel.getScoreLabel().setText(GameStrings.SCORE + model.getStatistics().getScore());
    gamePanel.getLivesLabel().setText(GameStrings.LIVES + model.getShip().getLives());
    gameController.setView(gamePanel);
    gamePanel.requestFocusInWindow();
    gamePanel.addKeyListener(new ShipController(this.model));
    this.mainFrame.replacePanel(gamePanel);
  }
View Full Code Here

    this.model.resetGame();
    this.model.getStatistics().resetStatistics();
    this.model.initIndividuals();
    this.model.initAchievements();
    GameController gameController = new GameController(this.mainFrame, this.model);
    GamePanel gamePanel = new GamePanel(this.model.getList());
    gamePanel.getScoreLabel().setText(GameStrings.SCORE + model.getStatistics().getScore());
    gamePanel.getLivesLabel().setText(GameStrings.LIVES + model.getShip().getLives());
    gameController.setView(gamePanel);
    gamePanel.requestFocusInWindow();
    gamePanel.addKeyListener(new ShipController(this.model));
    this.mainFrame.replacePanel(gamePanel);
  }
View Full Code Here

 
  public static void main(String[] args) {
    MainFrame mainFrame = new MainFrame();
    TestCollisionsInFrame f = new TestCollisionsInFrame();
    List<Individual> list = f.getList();
    GamePanel game = new GamePanel(list);
    Control cont = new Control(list);
    game.addKeyListener(cont);
    mainFrame.replacePanel(game);
    TestCollisions thread = new TestCollisions(list, game);
    thread.start();
    mainFrame.setVisible(true);
  }
View Full Code Here

    this.mainFrame.replacePanel(gameOverGUI);
  }

  @Override
  public void gameWon() {
    GameWon gameWonGUI = new GameWon();
    GameWonController gameWonController = new GameWonController(this.mainFrame, this.model);
    gameWonController.setView(gameWonGUI);
    this.mainFrame.replacePanel(gameWonGUI);
  }
View Full Code Here

TOP

Related Classes of oop13.space.testing.TestCollisionsInFrame.Control

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.