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.

34 lines
793 B

  1. package playground;
  2. import java.awt.Color;
  3. import gameobjects.*;
  4. import controller.*;
  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. // TODO your code here
  9. @Override
  10. public void prepareLevel(String id) {
  11. super.prepareLevel(id);
  12. RectObject blueBox = new RectObject("BlueBox", this, 300, 300, 170, 70, 30, 30, Color.BLUE);
  13. this.addObject(blueBox);
  14. ReboundController boxControl = new ReboundController();
  15. blueBox.addController(boxControl);
  16. }
  17. /** "Moving Objects Level!" is the message.
  18. *
  19. * @return String "Moving Objects Level!"
  20. */
  21. @Override
  22. protected String getStartupMessage() {
  23. return "Moving Objects Level!";
  24. }
  25. }