Browse Source

commit after pulling and updated gitignore

main
Lea Anton 3 years ago
parent
commit
de6f6dc896
  1. 14
      .gitignore
  2. 19
      GameProject/src/base/MultiLevelGame.java
  3. 27
      GameProject/src/playground/Level5.java
  4. 21
      GameProject/src/playground/Level5to7.java
  5. 31
      GameProject/src/playground/Level6.java
  6. 29
      GameProject/src/playground/Level7.java

14
.gitignore

@ -1,7 +1,19 @@
/.metadata/
*.metadata/
*.class
/GameProject/doc/
/GameProject/log/
/GameProject/log\\log4j.log
/GameProject/highscore.txt
/GameProject/bin/
.metadata/.log
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
.metadata/version.ini
.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.markers.snap
.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.syncinfo.snap
.metadata/.plugins/org.eclipse.core.resources/.projects/GameProject/.markers.snap
.metadata/.plugins/org.eclipse.core.resources/.projects/GameProject/.syncinfo.snap
.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap
.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
.metadata/.plugins/org.eclipse.core.resources/4.snap
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

19
GameProject/src/base/MultiLevelGame.java

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

27
GameProject/src/playground/Level5.java

@ -2,6 +2,31 @@ package playground;
public class Level5 extends SpaceInvadersLevel{
public class Level5 extends Level5to7{
protected static final double ENEMYSPEEDX = 160;
protected static final double ENEMYSPEEDY = 80;
protected static final int NR_ENEMIES = 5;
@Override
protected int calcNrEnemies() {
return NR_ENEMIES;
}
@Override
protected double calcEnemySpeedX() {
return ENEMYSPEEDX;
}
@Override
protected double calcEnemySpeedY() {
return ENEMYSPEEDY;
}
@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!!");
}
}

31
GameProject/src/playground/Level6.java

@ -0,0 +1,31 @@
package playground;
public class Level6 extends Level5to7 {
protected static final double ENEMYSPEEDX = 480;
protected static final double ENEMYSPEEDY = 80;
protected static final int NR_ENEMIES = 12;
protected int calcNrEnemies() {
return NR_ENEMIES;
}
@Override
protected double calcEnemySpeedX() {
return ENEMYSPEEDX;
}
@Override
protected double calcEnemySpeedY() {
return ENEMYSPEEDY;
}
@Override
protected String getStartupMessage() {
return "Level6, get ready";
}
}

29
GameProject/src/playground/Level7.java

@ -0,0 +1,29 @@
package playground;
public class Level7 extends Level5to7{
protected static final double ENEMYSPEEDX = 800;
protected static final double ENEMYSPEEDY = 140;
protected static final int NR_ENEMIES =21;
protected int calcNrEnemies() {
return NR_ENEMIES;
}
@Override
protected double calcEnemySpeedX() {
return ENEMYSPEEDX;
}
@Override
protected double calcEnemySpeedY() {
return ENEMYSPEEDY;
}
@Override
protected String getStartupMessage() {
return "Level7, get ready";
}
}
Loading…
Cancel
Save