package playground; import java.awt.Color; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import collider.RectCollider; import controller.ReboundController; import controller.ReboundController2; import gameobjects.GameObject; import gameobjects.RectObject; /** * Level that creates two RectObjects moving around and if ego is hit by them game is directly lost * (lives = 0). * */ public class LevelMovingHitObjects extends SpaceInvadersLevel { private static Logger logger1 = LogManager.getLogger(LevelMovingHitObjects.class); @Override public void prepareLevel(String id) { super.prepareLevel(id); RectObject fly_enemy1 = new RectObject("fly_enemy1", this, 300, 300, 75, 40, 40, 40, Color.BLUE); RectObject fly_enemy2 = new RectObject("fly_enemy2", this, 200, 200, 20, 90, 40, 40, Color.GREEN); logger1.info("Created two rectobjects"); ReboundController2 fly1_controller = new ReboundController2(); ReboundController2 fly2_controller = new ReboundController2(); logger1.info("Created two controllers"); fly_enemy1.addController(fly1_controller); fly_enemy2.addController(fly2_controller); logger1.info("Added controller to Rectbjects"); this.addObject(fly_enemy1); this.addObject(fly_enemy2); logger1.info("Added objects to LevelMoving