Browse Source

Finished HA03

main
Nico B 3 years ago
parent
commit
5b948a8024
  1. 19
      GameProject/src/base/MultiLevelGame.java
  2. 21
      GameProject/src/playground/Level5.java
  3. 21
      GameProject/src/playground/Level5to7.java
  4. 24
      GameProject/src/playground/Level6.java
  5. 22
      GameProject/src/playground/Level7.java

19
GameProject/src/base/MultiLevelGame.java

@ -4,26 +4,33 @@ import java.io.IOException;
import playground.Level1; import playground.Level1;
import playground.Level3; import playground.Level3;
import playground.Level5;
import playground.Level6;
import playground.Level7;
import playground.LevelBoss; import playground.LevelBoss;
import playground.LevelHitTwice; import playground.LevelHitTwice;
public class MultiLevelGame extends GameLoop { public class MultiLevelGame extends GameLoop {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
GameLoop gl = new MultiLevelGame();
MultiLevelGame gl = new MultiLevelGame();
gl.runGame(args); gl.runGame(args);
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
void defineLevels( ) { void defineLevels( ) {
this.addLevel(new Level1());
this.addLevel(new LevelHitTwice());
this.addLevel(new Level3());
this.addLevel(new LevelBoss());
//this.addLevel(new Level1());
//this.addLevel(new LevelHitTwice());
//this.addLevel(new Level3());
//this.addLevel(new LevelBoss());
this.addLevel(new Level5());
this.addLevel(new Level6());
this.addLevel(new Level7());
} }
} }

21
GameProject/src/playground/Level5.java

@ -2,6 +2,25 @@ package playground;
public class Level5 extends SpaceInvadersLevel{
public class Level5 extends Level5to7{
@Override
protected int calcNrEnemies() {
return 5;
}
@Override
protected double calcEnemySpeedX() {
return 160;
}
@Override
protected double calcEnemySpeedY() {
return 80;
}
@Override
protected String getStartupMessage() {
return "Level5, get ready";
}
} }

21
GameProject/src/playground/Level5to7.java

@ -0,0 +1,21 @@
package playground;
import java.awt.Color;
import gameobjects.GameObject;
public class Level5to7 extends SpaceInvadersLevel {
@Override
void actionIfEnemyIsHit(GameObject e, GameObject shot) {
super.actionIfEnemyIsHit(e, shot);
System.out.println("AUA!!");
}
}

24
GameProject/src/playground/Level6.java

@ -1,7 +1,27 @@
package playground; package playground;
import SpacInvadersLevel;
public class Level6 extends SpacInvadersLevel {
public class Level6 extends Level5to7 {
protected int calcNrEnemies() {
return 12;
}
@Override
protected double calcEnemySpeedX() {
return 480;
}
@Override
protected double calcEnemySpeedY() {
return 80;
}
@Override
protected String getStartupMessage() {
return "Level6, get ready";
}
} }

22
GameProject/src/playground/Level7.java

@ -1,5 +1,25 @@
package playground; package playground;
public class Level7 extends SpaceInvadersLevel {
public class Level7 extends Level5to7{
protected int calcNrEnemies() {
return 21;
}
@Override
protected double calcEnemySpeedX() {
return 800;
}
@Override
protected double calcEnemySpeedY() {
return 140;
}
@Override
protected String getStartupMessage() {
return "Level7, get ready";
}
} }
Loading…
Cancel
Save