fdai7303
3 years ago
4 changed files with 102 additions and 4 deletions
-
14GameProject/src/base/MultiLevelGame.java
-
47GameProject/src/playground/Level5.java
-
21GameProject/src/playground/Level6.java
-
24GameProject/src/playground/Level7.java
@ -0,0 +1,47 @@ |
|||
package playground; |
|||
|
|||
import java.awt.Color; |
|||
|
|||
import gameobjects.GameObject; |
|||
|
|||
public class Level5 extends SpaceInvadersLevel { |
|||
|
|||
@Override |
|||
protected int calcNrEnemies() { |
|||
return 5;//SpaceInvadersLevel.NR_ENEMIES; |
|||
} |
|||
|
|||
protected double calcEnemySpeedX() { |
|||
return 160; |
|||
} |
|||
|
|||
protected double calcEnemySpeedY() { |
|||
return 80; |
|||
} |
|||
|
|||
protected String getStartupMessage() { |
|||
return "Level 5, get ready!"; |
|||
} |
|||
|
|||
@Override |
|||
void actionIfEnemyIsHit(GameObject e, GameObject shot) { |
|||
|
|||
double gameTime = this.getGameTime(); |
|||
createExplosion(gameTime, e, "shard", DYING_INTERVAL, Color.RED); |
|||
|
|||
Music.music(smash); |
|||
|
|||
// delete enemy |
|||
deleteObject(e.getId()); |
|||
|
|||
// delete shot |
|||
deleteObject(shot.getId()); |
|||
|
|||
// add to points counter |
|||
Integer pts = (Integer) getGlobalFlag("points"); |
|||
setGlobalFlag("points", pts + 200); |
|||
|
|||
//Enemy scream |
|||
System.out.println("AUA!"); |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
package playground; |
|||
|
|||
public class Level6 extends SpaceInvadersLevel { |
|||
|
|||
@Override |
|||
protected int calcNrEnemies() { |
|||
return 12;//SpaceInvadersLevel.NR_ENEMIES; |
|||
} |
|||
|
|||
protected double calcEnemySpeedX() { |
|||
return 480; |
|||
} |
|||
|
|||
protected double calcEnemySpeedY() { |
|||
return 80; |
|||
} |
|||
|
|||
protected String getStartupMessage() { |
|||
return "Level 6, get ready!"; |
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
package playground; |
|||
|
|||
public class Level7 extends SpaceInvadersLevel { |
|||
|
|||
@Override |
|||
protected int calcNrEnemies() { |
|||
return 21;//SpaceInvadersLevel.NR_ENEMIES; |
|||
} |
|||
|
|||
@Override |
|||
protected double calcEnemySpeedX() { |
|||
return 800; |
|||
} |
|||
|
|||
@Override |
|||
protected double calcEnemySpeedY() { |
|||
return 140; |
|||
} |
|||
|
|||
@Override |
|||
protected String getStartupMessage() { |
|||
return "Level 7, get ready!"; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue