You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
650 B

  1. package controller;
  2. import org.apache.logging.log4j.Logger;
  3. import org.apache.logging.log4j.LogManager;
  4. /**
  5. * Controls background stars. When they touch the bottom of the display they reappear on top.
  6. */
  7. public class FallingStarController extends ObjectController {
  8. int rad = 3;
  9. private static Logger logger = LogManager.getLogger(FallingStarController.class);
  10. @Override
  11. public void updateObject() {
  12. logger.trace(
  13. "+" + this.gameObject.getId() + " HO " + this.gameObject + "/" + this.getPlayground());
  14. if (this.getY() + rad >= this.getPlayground().getSizeY()) {
  15. this.setY(10);
  16. }
  17. applySpeedVector();
  18. }
  19. }