Space von Team 22 (Nico B. Benjamin F. Lea A.)
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.

38 lines
963 B

2 years ago
2 years ago
2 years ago
  1. package playground;
  2. import java.awt.Color;
  3. import controller.ReboundController;
  4. import gameobjects.RectObject;
  5. /** This level adds two distracting objects to the canvas that cannot collide but bounce around all the time.
  6. */
  7. public class LevelMovingObjects extends SpaceInvadersLevel {
  8. /** "Moving Objects Level!" is the message.
  9. *
  10. * @return String "Moving Objects Level!"
  11. */
  12. @Override
  13. protected String getStartupMessage() {
  14. return "Moving Objects Level!";
  15. }
  16. @Override
  17. public void prepareLevel(String id) {
  18. super.prepareLevel(id);
  19. RectObject ro = new RectObject("ro", this, 300, 300, 170, 70, 30, 30, Color.BLUE);
  20. RectObject roTwo = new RectObject("roTwo", this, 200, 200, 50, 170, 30, 30, Color.GREEN);
  21. ReboundController rc = new ReboundController();
  22. ReboundController rcTwo = new ReboundController();
  23. ro.addController(rc);
  24. roTwo.addController(rcTwo);
  25. this.addObject(ro);
  26. this.addObject(roTwo);
  27. }
  28. }