|
@ -0,0 +1,67 @@ |
|
|
|
|
|
package playground; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
|
|
|
|
|
|
|
import collider.RectCollider; |
|
|
|
|
|
import controller.EgoController; |
|
|
|
|
|
import controller.ReboundController; |
|
|
|
|
|
import gameobjects.FallingStar; |
|
|
|
|
|
import gameobjects.GameObject; |
|
|
|
|
|
import gameobjects.RectObject; |
|
|
|
|
|
|
|
|
|
|
|
public class BreakoutLevel1 extends BreakoutLevelBase{ |
|
|
|
|
|
|
|
|
|
|
|
@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() { |
|
|
|
|
|
|
|
|
|
|
|
GameObject NewEgo = new RectObject("Ego", this, 350, 550, 0, 0, 80 , 10 , null); |
|
|
|
|
|
NewEgo.addController(new EgoController(gameTime)); |
|
|
|
|
|
NewEgo.addCollider(new RectCollider("Ego", NewEgo, 80, 10)); |
|
|
|
|
|
|
|
|
|
|
|
return NewEgo; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
protected GameObject createBall() { |
|
|
|
|
|
|
|
|
|
|
|
GameObject Ball = new FallingStar("Ball", this, 350, 350, 120, 120, Color.red, 5); |
|
|
|
|
|
Ball.addController(new ReboundController()); |
|
|
|
|
|
|
|
|
|
|
|
return Ball; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
protected GameObject createBrick(int row, int column) { |
|
|
|
|
|
|
|
|
|
|
|
GameObject Brick = new RectObject("brick", this, 40, 40, 0, 0, 60, 30, Color.green); |
|
|
|
|
|
Brick.addCollider(new RectCollider("brick", Brick, 60, 30)); |
|
|
|
|
|
|
|
|
|
|
|
return Brick; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void prepareLevel(String level) { |
|
|
|
|
|
|
|
|
|
|
|
this.addObject(createEgoObject()); |
|
|
|
|
|
this.addObject(createBall()); |
|
|
|
|
|
this.addObject(createBrick(10, 3)); |
|
|
|
|
|
this.addObject(ball); |
|
|
|
|
|
this.addObject(ego); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |