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.

35 lines
770 B

package playground;
import java.awt.Color;
import gameobjects.RectObject;
/**
* extends {@link SpaceInvadersLevel} with a red Rectangle with no function.
*/
public class LevelWithBox extends SpaceInvadersLevel {
/**
* calls prepareLevel from SpaceInvadersLevel and adds a red Rectangle with no function.
*
* @param id String identifies Level
*/
@Override
public void prepareLevel(String id) {
super.prepareLevel(id);
RectObject redRect = new RectObject("redRect", this, 350, 100, 0, 0, 700, 250, Color.RED);
this.addObject(redRect);
}
/**
* simply returns the text that should be displayed at level start.
*
* @return String "Box-Level!"
*/
@Override
protected String getStartupMessage() {
return "Box-Level!";
}
}