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.
30 lines
759 B
30 lines
759 B
package playground;
|
|
import java.awt.Color;
|
|
import gameobjects.*;
|
|
|
|
/** This class adds a new level to the game.
|
|
*
|
|
* @author team22
|
|
*/
|
|
public class LevelWithBox extends SpaceInvadersLevel {
|
|
|
|
/** This method overrides the initial method and adds a red rectangle on the top which does not do anything.
|
|
*
|
|
* @param id String identifies level
|
|
*/
|
|
@Override
|
|
public void prepareLevel(String id) {
|
|
super.prepareLevel(id);
|
|
RectObject rectangle = new RectObject("rectangle", this, 350, 100, 0, 0, 700, 250, Color.RED);
|
|
addObject(rectangle);
|
|
}
|
|
|
|
/** This method overrides the initial method to change the startup message.
|
|
*
|
|
* @return String Startup message
|
|
*/
|
|
@Override
|
|
protected String getStartupMessage() {
|
|
return "Box-Level!";
|
|
}
|
|
}
|