i think it works now

master
Marcus Gosselin 2014-11-01 12:30:32 -04:00
parent 0652f56d9e
commit ed490d5cfc
3 changed files with 12 additions and 11 deletions

1
bin/.gitignore vendored
View File

@ -1 +0,0 @@
/MAndApps/

View File

@ -24,7 +24,7 @@ import MAndEngine.BasicApp;
import MAndEngine.Engine; import MAndEngine.Engine;
public class SpaceWars implements BasicApp { public class SpaceWars implements BasicApp {
// //
private static boolean paused = false, debug = false; private static boolean paused = false, debug = false;
private static int redPoints = 0, bluePoints = 0, greenPoints = 0, time = 0; private static int redPoints = 0, bluePoints = 0, greenPoints = 0, time = 0;
@ -38,7 +38,7 @@ public class SpaceWars implements BasicApp {
private static int lvl = 1, xpToNextLVL = getMaxXPForLvl(lvl), xp = 0, expBar = 424; private static int lvl = 1, xpToNextLVL = getMaxXPForLvl(lvl), xp = 0, expBar = 424;
private static boolean shopping = false; private static boolean shopping = false;
private Shop shop = new Shop(); private Shop shop = new Shop();
// //
public static final Font defaultFont = new Font("Ubuntu", Font.BOLD, 10); public static final Font defaultFont = new Font("Ubuntu", Font.BOLD, 10);
public static final Font moneyFont = new Font("Ubuntu", Font.BOLD, 20); public static final Font moneyFont = new Font("Ubuntu", Font.BOLD, 20);
@ -81,7 +81,7 @@ public class SpaceWars implements BasicApp {
log("You gained " + enemies.elementAt(i).getWorth() + " exp."); log("You gained " + enemies.elementAt(i).getWorth() + " exp.");
addEXP(enemies.elementAt(i).getWorth()); addEXP(enemies.elementAt(i).getWorth());
//enemies.remove(i); // enemies.remove(i);
} else } else
i++; i++;
@ -112,15 +112,15 @@ public class SpaceWars implements BasicApp {
public static Stack<Enemy> getEnemies() { public static Stack<Enemy> getEnemies() {
return enemies; return enemies;
} }
@Override @Override
public void render(Graphics2D g) { public void render(Graphics2D g) {
try { try {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setFont(defaultFont); g.setFont(defaultFont);
g.drawImage(background, 0, 0, WIDTH, HEIGHT, null); g.drawImage(background, 0, 0, WIDTH, HEIGHT, null);
@ -280,7 +280,7 @@ public class SpaceWars implements BasicApp {
} }
private static int getMaxXPForLvl(int lvl) { private static int getMaxXPForLvl(int lvl) {
return (int)(Math.pow(lvl, 1.618)); return (int) (Math.pow(lvl, 1.618));
} }
public void addEXP(int i) { public void addEXP(int i) {
@ -333,12 +333,14 @@ public class SpaceWars implements BasicApp {
@Override @Override
public void resized(int width, int height) { public void resized(int width, int height) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void click() { public void click() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
BOOM(75, 1.2, 100, 100, 100, 50, Engine.mouseX, Engine.mouseY, 550, true, true, 10);
} }
} }

View File

@ -4,7 +4,7 @@ import MAndEngine.Engine;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
Engine engine = new Engine(new String[] {"MAndApps.apps.SpaceWars"}, false); Engine engine = new Engine(new String[] {"MAndApps.apps.spacewars.SpaceWars"}, false);
engine.run(); engine.run();
} }