Graphics Changes & Changed Fire butto to USE_CREDIT

This commit is contained in:
Sagi Dayan 2016-03-19 21:24:40 +02:00
parent 1f917a7d71
commit 35c665fcc8
3 changed files with 15 additions and 11 deletions

View File

@ -34,7 +34,7 @@ public class GameEngine {
private Scene scene;
private int p1CreditTime, p2CreditTime, creditTickTime = 1;
public static final int PLAYER_WIDTH = 120, PLAYER_HEIGHT = 120;
public static final int UP=0,RIGHT=1,DOWN=2, LEFT=3, FIRE=4, SPECIAL=5;
public static final int UP=0,RIGHT=1,DOWN=2, LEFT=3, FIRE=4, USE_CREDIT=5;
public int p1HighScore, p2HighScore;
private int[] p1Controlles = {KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT, KeyEvent.VK_K, KeyEvent.VK_J};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 KiB

After

Width:  |  Height:  |  Size: 328 KiB

View File

@ -204,12 +204,14 @@ public abstract class Level extends Scene {
p1Missiles.add(new Missile(players.get(0).getCenterX() - 15, (int)players.get(0).getLocY(), players.get(0).getAcceleration() + 3, "P1Laser.png", 4));
players.get(0).updateFireTime();
}
if(engine.getP1Health() <= 0 && engine.getCredits() > 0) {
engine.revivePlayer(0);
players.get(0).resetPlayer();
}
}
if(keys.get(engine.getP1Controlles()[GameEngine.USE_CREDIT]) && engine.getP1Health() <= 0 ){
if(engine.getCredits() > 0) {
engine.revivePlayer(0);
players.get(0).resetPlayer();
}
}
/**
* Player 2 Movement
@ -238,12 +240,14 @@ public abstract class Level extends Scene {
p2Missiles.add(new Missile(players.get(1).getCenterX() - 15, (int)players.get(1).getLocY(), players.get(1).getAcceleration() + 3, "P1Laser.png", 4));
players.get(1).updateFireTime();
}
if(engine.getP2Health() <= 0 && engine.getCredits() > 0) {
engine.revivePlayer(1);
players.get(0).resetPlayer();
}
}
if(keys.get(engine.getP2Controlles()[GameEngine.USE_CREDIT]) && engine.getP2Health() <= 0){
if(engine.getCredits() > 0) {
engine.revivePlayer(1);
players.get(1).resetPlayer();
}
}
}
}