コード例 #1
0
 public void undoChangeBallType() {
   if (undoBallType != null && undo) {
     LevelScreen screen = levelScreenManager.getScreen();
     BallShooter shooter = screen.getShooter();
     shooter.changeBallType(undoBallType);
     undo = false;
   }
 }
コード例 #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;
   }
 }
コード例 #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
  }
コード例 #4
0
 public void throwBall() {
   LevelScreen screen = levelScreenManager.getScreen();
   BallShooter shooter = screen.getShooter();
   shooter.shoot();
 }
コード例 #5
0
 public void rotateShooter(int angle) {
   LevelScreen screen = levelScreenManager.getScreen();
   BallShooter shooter = screen.getShooter();
   shooter.rotate(angle);
 }