Examples of IPacmanInteraction


Examples of org.jpacman.framework.ui.IPacmanInteraction

  @Test
  public void testUIActions() throws FactoryException, InterruptedException {
    MainUI ui = new MainUI();
    ui.initializeNormalGame();
    ui.start();
    IPacmanInteraction eventHandler = ui.eventHandler();

    // now trigger interesting events.
    eventHandler.start();
    eventHandler.up();
    eventHandler.left();

    // give the ghosts some time to move.
    final int nrOfGhostMovesToWait = 10;
    Thread.sleep(nrOfGhostMovesToWait * AbstractGhostMover.DELAY);

    // and attempt some moves again.
    eventHandler.down();
    eventHandler.stop();
    eventHandler.start();
    eventHandler.right();
   
    // and we're done.
    eventHandler.exit();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.