public void undoChangeBallType() { if (undoBallType != null && undo) { LevelScreen screen = levelScreenManager.getScreen(); BallShooter shooter = screen.getShooter(); shooter.changeBallType(undoBallType); undo = false; } }
public void changeBallType(Ball.BallType type) { if (gameManager.hasItem(type)) { LevelScreen screen = levelScreenManager.getScreen(); BallShooter shooter = screen.getShooter(); shooter.changeBallType(type); undo = true; } }
@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 }
public void throwBall() { LevelScreen screen = levelScreenManager.getScreen(); BallShooter shooter = screen.getShooter(); shooter.shoot(); }
public void rotateShooter(int angle) { LevelScreen screen = levelScreenManager.getScreen(); BallShooter shooter = screen.getShooter(); shooter.rotate(angle); }