Browse Source

´hallo

main
Nour 3 years ago
parent
commit
7c904a3634
  1. 37
      GameProject/src/base/MultiLevelGame.java
  2. 39
      GameProject/src/playground/Level5.java
  3. 36
      GameProject/src/playground/Level6.java
  4. 35
      GameProject/src/playground/Level7.java
  5. 44
      GameProject/src/playground/LevelWithBox.java
  6. 12
      GameProject/src/playground/SU.java

37
GameProject/src/base/MultiLevelGame.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);
}
}

39
GameProject/src/playground/Level5.java

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

36
GameProject/src/playground/Level6.java

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

35
GameProject/src/playground/Level7.java

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

44
GameProject/src/playground/LevelWithBox.java

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

12
GameProject/src/playground/SU.java

@ -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!!");
}
}
Loading…
Cancel
Save