Nour
3 years ago
6 changed files with 203 additions and 0 deletions
-
37GameProject/src/base/MultiLevelGame.java
-
39GameProject/src/playground/Level5.java
-
36GameProject/src/playground/Level6.java
-
35GameProject/src/playground/Level7.java
-
44GameProject/src/playground/LevelWithBox.java
-
12GameProject/src/playground/SU.java
@ -0,0 +1,37 @@ |
|||
package base; |
|||
|
|||
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; |
|||
import playground.LevelWithBox; |
|||
|
|||
public class MultiLevelGame extends GameLoop { |
|||
|
|||
|
|||
@Override |
|||
|
|||
void defineLevels() { |
|||
this.addLevel(new LevelWithBox()); |
|||
this.addLevel(new Level5()); |
|||
this.addLevel(new Level6()); |
|||
this.addLevel(new Level7()); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public static void main(String[] args) throws IOException { |
|||
MultiLevelGame prog2 = new MultiLevelGame(); |
|||
prog2.runGame(args); |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
package playground; |
|||
|
|||
import java.awt.Color; |
|||
|
|||
import gameobjects.GameObject; |
|||
|
|||
public class Level5 extends SU{ |
|||
|
|||
|
|||
@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!"; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
@ -0,0 +1,36 @@ |
|||
package playground; |
|||
|
|||
import java.awt.Color; |
|||
|
|||
import gameobjects.GameObject; |
|||
|
|||
public class Level6 extends SU{ |
|||
|
|||
|
|||
|
|||
@Override |
|||
|
|||
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!"; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package playground; |
|||
|
|||
import java.awt.Color; |
|||
|
|||
import gameobjects.GameObject; |
|||
|
|||
public class Level7 extends SU{ |
|||
|
|||
|
|||
|
|||
@Override |
|||
|
|||
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!"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package playground; |
|||
|
|||
import gameobjects.GameObject; |
|||
|
|||
import gameobjects.RectObject; |
|||
|
|||
import java.awt.Color; |
|||
|
|||
/** |
|||
* Represents the LevelWithBox. |
|||
* @author Nour Den Almasri |
|||
* |
|||
*/ |
|||
|
|||
public class LevelWithBox extends SpaceInvadersLevel { |
|||
|
|||
/** |
|||
* Method prepares the new level. |
|||
* @param id String represents the level |
|||
* |
|||
*/ |
|||
|
|||
@Override |
|||
|
|||
public void prepareLevel(String id) { |
|||
super.prepareLevel(id); |
|||
GameObject o = new RectObject("red", this, 350, 100, 0, 0, 700, 250, Color.RED); |
|||
this.addObject(o); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* Method show the Start's message. |
|||
* @return the message should be showed |
|||
*/ |
|||
|
|||
@Override |
|||
|
|||
protected String getStartupMessage() { |
|||
return "Get ready for box-Level!"; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package playground; |
|||
|
|||
import gameobjects.GameObject; |
|||
|
|||
public class SU extends SpaceInvadersLevel{ |
|||
|
|||
|
|||
void actionIfEnemyIsHit(GameObject e, GameObject shot) { |
|||
super.actionIfEnemyIsHit(e, shot); |
|||
System.out.println("AUA!!"); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue