Alisa95
3 years ago
2 changed files with 108 additions and 0 deletions
-
49spaceinvaders/GameProject/log/log4j.log
-
59spaceinvaders/GameProject/src/playground/BreakoutLevel1.java
@ -0,0 +1,59 @@ |
|||||
|
package playground; |
||||
|
|
||||
|
import java.awt.Color; |
||||
|
import org.apache.logging.log4j.LogManager; |
||||
|
import org.apache.logging.log4j.Logger; |
||||
|
import controller.*; |
||||
|
import collider.RectCollider; |
||||
|
import gameobjects.FallingStar; |
||||
|
import gameobjects.GameObject; |
||||
|
import gameobjects.RectObject; |
||||
|
|
||||
|
public class BreakoutLevel1 extends BreakoutLevelBase { |
||||
|
|
||||
|
private static Logger logger = LogManager.getLogger(BreakoutLevel1.class); |
||||
|
|
||||
|
@Override |
||||
|
protected void actionIfBallHitsBrick(GameObject ball, GameObject brick) { |
||||
|
// TODO Auto-generated method stub |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected void actionIfBallHitsEgo(GameObject ball, GameObject ego) { |
||||
|
// TODO Auto-generated method stub |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected GameObject createEgoObject() { |
||||
|
RectObject blueBox = new RectObject("ego", this, 350, 550, 0, 0, 80, 10, Color.BLUE); |
||||
|
blueBox.generateColliders(); |
||||
|
EgoController ec = new EgoController(30); |
||||
|
blueBox.addController(ec); |
||||
|
logger.info("ego created."); |
||||
|
return blueBox; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected GameObject createBall() { |
||||
|
GameObject ball = new FallingStar("ball1", this, 350, 350, 120, 120, Color.RED, 5); |
||||
|
ball.addController(new ReboundController()); |
||||
|
logger.info("ball created."); |
||||
|
return ball; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected GameObject createBrick(int row, int column) { |
||||
|
// TODO Auto-generated method stub |
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void prepareLevel(String level) { |
||||
|
// TODO Auto-generated method stub |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue