@ -8,6 +8,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import gameobjects.GameObject;
import playground.Level1;
import playground.LevelMovingObjects;
import playground.LevelWithBox;
import playground.Playground;
import ui.GameUI;
@ -56,7 +57,7 @@ public class GameLoop {
*/
void defineLevels() {
this.resetLevels();
this.addLevel(new LevelWithBox());
this.addLevel(new LevelMovingObjects());
}
/**
@ -3,13 +3,14 @@ package base;
import java.io.IOException;
import playground.Level5;
public class MultiLevelGame extends GameLoop {
@ -1,12 +1,19 @@
package playground;
import java.awt.Color;
import gameobjects.RectObject;
/** 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
public void prepareLevel(String id) {
super.prepareLevel(id);
LevelMovingObjects ml = this;
RectObject object2 = new RectObject(id +"Bluebox",ml,300,300,170,70,30,30,Color.BLUE);
this.addObject(object2);
/** "Moving Objects Level!" is the message.
@ -25,7 +25,8 @@ public class LevelWithBox extends SpaceInvadersLevel {
RectObject Object = new RectObject(id,null,350,100,0,0,700,250,Color.RED);
LevelWithBox myLevel = this;
RectObject Object = new RectObject(id,myLevel,350,100,0,0,700,250,Color.RED);
this.addObject(Object);