Skip to content
Permalink
Browse files

This should work now

  • Loading branch information
jdm13003 committed Apr 27, 2016
1 parent 035a73a commit 62f0528541409b626ad961758424f3910b26ac45
Showing with 26 additions and 3 deletions.
  1. +4 −0 src/main/Controller.java
  2. +6 −1 src/main/EnemyFighter.java
  3. +6 −1 src/main/Player.java
  4. +4 −1 src/main/Player2.java
  5. +6 −0 src/main/StarDestroyer.java
@@ -34,6 +34,10 @@ public void createEnemy(int enemy_count){

}
}




public void createSD(int SDcount){
for(int n = 0; n < SDcount; n++){
addEntity(new StarDestroyer(810, r.nextInt(400), skin, this, game));
@@ -26,6 +26,10 @@ public double getX(){
return x;
}
public void shoot(){
if (x <= -32 ){
controller.removeEntity(this);
game.setTieKills(game.getTieKills()+1);
}
if(is_shooting == 0){
controller.addEntity(new EnemyLaser(x, y, skin, game));
is_shooting++;
@@ -47,7 +51,8 @@ public void tick(){
if(GamePhysics.Collision(this, tempa)){
controller.removeEntity(this);
controller.removeEntity(tempa);
game.setKills(game.getKills()+1);
game.setTieKills(game.getTieKills()+1);
game.setScore(game.getScore()+10);
}
}
}
@@ -43,7 +43,9 @@ public void tick(){
EntityTypeD tempa = game.ed.get(n);
if(GamePhysics.Collision(this, tempa)){
if(health == 1){
controller.removeEntity(this);}
game.State = game.State.END;
health = 3;
}
else{
health--;
controller.removeEntity(tempa);
@@ -78,5 +80,8 @@ public void setVelY(double velY){
public Rectangle getBounds(){
return new Rectangle((int)x, (int) y, 64, 64);
}
public int getHealth(){
return health;
}

}
@@ -43,7 +43,10 @@ public void tick(){
EntityTypeD tempa = game.ed.get(n);
if(GamePhysics.Collision(this, tempa)){
if(health == 1){
controller.removeEntity(this);}
controller.removeEntity(this);
game.State = game.State.END;
health = 4;
}
else{
health--;
controller.removeEntity(tempa);
@@ -28,6 +28,10 @@ public double getX(){
}

public void tick(){
if (x <= -100 ){
controller.removeEntity(this);
game.setTieKills(game.getTieKills()+1);
}
x -= speed;
shoot();
for(int n = 0; n < game.ea.size(); n++){
@@ -36,6 +40,8 @@ public void tick(){
if(GamePhysics.Collision(this, tempa)){
if(health ==1)
{controller.removeEntity(this);
game.setSDKills(game.getSDKills()+1);
game.setScore(game.getScore()+100);
}
else{health--;}
controller.removeEntity(tempa);

0 comments on commit 62f0528

Please sign in to comment.
You can’t perform that action at this time.