Exemplo n.º 1
0
 public void undoChangeBallType() {
   if (undoBallType != null && undo) {
     LevelScreen screen = levelScreenManager.getScreen();
     BallShooter shooter = screen.getShooter();
     shooter.changeBallType(undoBallType);
     undo = false;
   }
 }
Exemplo n.º 2
0
 public void changeBallType(Ball.BallType type) {
   if (gameManager.hasItem(type)) {
     LevelScreen screen = levelScreenManager.getScreen();
     BallShooter shooter = screen.getShooter();
     shooter.changeBallType(type);
     undo = true;
   }
 }
Exemplo n.º 3
0
  @Override
  public void actionPerformed(ActionEvent arg0) {
    LevelScreen screen = levelScreenManager.getScreen();
    BallShooter shooter = screen.getShooter();
    BallSequence sequence = screen.getSequence();
    Hole hole = screen.getHole();

    sequence.slide();

    if (shooter.getShooting()) {
      shooter.shoot();

      Ball current = shooter.getCurrent();
      if (sequence.contains(current.getPoint())) {
        collisionManager.updateSequence(current, sequence);
        shooter.switchShooting();
      }
    }

    if (hole.containsBall(sequence)) finishLevel(0); // lost
    if (sequence.getSize() == 0) finishLevel(1); // won
  }
Exemplo n.º 4
0
 public void throwBall() {
   LevelScreen screen = levelScreenManager.getScreen();
   BallShooter shooter = screen.getShooter();
   shooter.shoot();
 }
Exemplo n.º 5
0
 public void rotateShooter(int angle) {
   LevelScreen screen = levelScreenManager.getScreen();
   BallShooter shooter = screen.getShooter();
   shooter.rotate(angle);
 }