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!"); } }