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
34 lines
793 B
package playground;
|
|
|
|
import java.awt.Color;
|
|
|
|
import gameobjects.*;
|
|
import controller.*;
|
|
|
|
/** This level adds two distracting objects to the canvas that cannot collide but bounce around all the time.
|
|
*/
|
|
public class LevelMovingObjects extends SpaceInvadersLevel {
|
|
|
|
// TODO your code here
|
|
|
|
@Override
|
|
public void prepareLevel(String id) {
|
|
super.prepareLevel(id);
|
|
RectObject blueBox = new RectObject("BlueBox", this, 300, 300, 170, 70, 30, 30, Color.BLUE);
|
|
this.addObject(blueBox);
|
|
ReboundController boxControl = new ReboundController();
|
|
blueBox.addController(boxControl);
|
|
}
|
|
|
|
|
|
|
|
/** "Moving Objects Level!" is the message.
|
|
*
|
|
* @return String "Moving Objects Level!"
|
|
*/
|
|
@Override
|
|
protected String getStartupMessage() {
|
|
return "Moving Objects Level!";
|
|
}
|
|
}
|
|
|