Revert "i made a booboo"

This reverts commit bac8633be7.
master
Marcus Gosselin 2015-03-03 14:45:24 -05:00
parent bac8633be7
commit 172ffbc4aa
15 changed files with 24 additions and 47 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry combineaccessrules="false" kind="src" path="/MAndEngine"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/MAndEngine"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

1
.gitignore vendored
View File

@ -43,4 +43,3 @@ Icon
Network Trash Folder Network Trash Folder
Temporary Items Temporary Items
.apdisk .apdisk
/bin/

View File

@ -8,7 +8,6 @@ import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.Transparency;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.net.URL; import java.net.URL;
@ -190,7 +189,7 @@ public class SpaceWars implements BasicApp {
try { try {
background = ImageIO.read(new URL("http://wallpapersus.com/wallpapers/2012/10/Cool-Wave-600x1024.jpg")); background = ImageIO.read(new URL("http://wallpapersus.com/wallpapers/2012/10/Cool-Wave-600x1024.jpg"));
} catch (Exception e) { } catch (Exception e) {
background = new BufferedImage(1024, 600, Transparency.TRANSLUCENT); background = (Image) new BufferedImage(1024, 600, BufferedImage.TRANSLUCENT);
Graphics g = background.getGraphics(); Graphics g = background.getGraphics();
g.setColor(Color.BLUE); g.setColor(Color.BLUE);
g.fillRect(0, 0, 1024, 600); g.fillRect(0, 0, 1024, 600);

View File

@ -21,7 +21,7 @@ public class Player extends Entity {
private boolean goBoom = false; private boolean goBoom = false;
public Player() { public Player() {
super(512, 550, WIDTH, HEIGHT); super((int) 512, (int) 550, WIDTH, HEIGHT);
} }
@Override @Override

View File

@ -30,7 +30,6 @@ public class BasicPlayerBullet extends Bullet {
updateBoundingBox((int) this.x, (int) this.y, WIDTH, HEIGHT); updateBoundingBox((int) this.x, (int) this.y, WIDTH, HEIGHT);
} }
@Override
public int tick() { public int tick() {
if (alive) { if (alive) {
if (direction == Direction.UP) { if (direction == Direction.UP) {
@ -59,7 +58,6 @@ public class BasicPlayerBullet extends Bullet {
return 0; return 0;
} }
@Override
public void render(Graphics g) { public void render(Graphics g) {
g.setColor(Color.BLACK); g.setColor(Color.BLACK);
if (alive) if (alive)
@ -76,13 +74,11 @@ public class BasicPlayerBullet extends Bullet {
return 1; return 1;
} }
@Override public int getWIDTH(){
public int getWIDTH(){
return WIDTH; return WIDTH;
} }
@Override public int getHEIGHT(){
public int getHEIGHT(){
return HEIGHT; return HEIGHT;
} }

View File

@ -19,13 +19,11 @@ public class PlayerExplodeBullet extends Bullet {
private final int size; private final int size;
private static final double PHI = 1.618033988749894848204586; private static final double PHI = 1.618033988749894848204586;
@Override public int getWIDTH(){
public int getWIDTH(){
return WIDTH; return WIDTH;
} }
@Override public int getHEIGHT(){
public int getHEIGHT(){
return HEIGHT; return HEIGHT;
} }
@ -47,7 +45,6 @@ public class PlayerExplodeBullet extends Bullet {
} }
@Override
public int tick() { public int tick() {
if (alive) { if (alive) {
if (direction == Direction.UP) { if (direction == Direction.UP) {
@ -78,7 +75,6 @@ public class PlayerExplodeBullet extends Bullet {
return 0; return 0;
} }
@Override
public void render(Graphics g) { public void render(Graphics g) {
g.setColor(Color.BLACK); g.setColor(Color.BLACK);
if (alive) if (alive)

View File

@ -16,13 +16,11 @@ public class PlayerImpactBullet extends Bullet {
private boolean alive = true; private boolean alive = true;
private final int level; private final int level;
@Override public int getWIDTH(){
public int getWIDTH(){
return WIDTH; return WIDTH;
} }
@Override public int getHEIGHT(){
public int getHEIGHT(){
return HEIGHT; return HEIGHT;
} }
@ -42,7 +40,6 @@ public class PlayerImpactBullet extends Bullet {
this.level = level; this.level = level;
} }
@Override
public int tick() { public int tick() {
if (alive) { if (alive) {
if (direction == Direction.UP) { if (direction == Direction.UP) {
@ -71,7 +68,6 @@ public class PlayerImpactBullet extends Bullet {
return 0; return 0;
} }
@Override
public void render(Graphics g) { public void render(Graphics g) {
g.setColor(Color.BLACK); g.setColor(Color.BLACK);
if (alive) if (alive)

View File

@ -17,13 +17,11 @@ public class PlayerPiercingBullet extends Bullet {
private final boolean INFINISHOT; private final boolean INFINISHOT;
final boolean lolface = true; final boolean lolface = true;
@Override public int getWIDTH(){
public int getWIDTH(){
return WIDTH; return WIDTH;
} }
@Override public int getHEIGHT(){
public int getHEIGHT(){
return HEIGHT; return HEIGHT;
} }
@ -44,7 +42,6 @@ public class PlayerPiercingBullet extends Bullet {
INFINISHOT = b; INFINISHOT = b;
} }
@Override
public int tick() { public int tick() {
oldX = x; oldX = x;
oldY = y; oldY = y;

View File

@ -137,7 +137,7 @@ public class BlueEnemy extends Enemy {
g.setColor(color); g.setColor(color);
int temp; int temp;
try{ try{
temp = r.nextInt((int)(0-(absoluteTime/20d))+5); temp = r.nextInt((int)(0-((double)absoluteTime/20d))+5);
}catch(Exception e){ }catch(Exception e){
temp = 0; temp = 0;
} }

View File

@ -142,7 +142,7 @@ public class GreenEnemy extends Enemy {
g.setColor(color); g.setColor(color);
int temp; int temp;
try{ try{
temp = r.nextInt((int)(0-(absoluteTime/20d))+5); temp = r.nextInt((int)(0-((double)absoluteTime/20d))+5);
}catch(Exception e){ }catch(Exception e){
temp = 0; temp = 0;
} }

View File

@ -137,7 +137,7 @@ public class NormalEnemy extends Enemy {
g.setColor(color); g.setColor(color);
int temp; int temp;
try{ try{
temp = r.nextInt((int)(0-(absoluteTime/20d))+5); temp = r.nextInt((int)(0-((double)absoluteTime/20d))+5);
}catch(Exception e){ }catch(Exception e){
temp = 0; temp = 0;
} }

View File

@ -27,8 +27,7 @@ public class RedEnemy extends Enemy {
} }
@Override public int tick() {
public int tick() {
// epic AI // epic AI
if((int)healthBar <= 0){ if((int)healthBar <= 0){
alive = false; alive = false;
@ -131,12 +130,11 @@ public class RedEnemy extends Enemy {
private Random r = new Random(); private Random r = new Random();
private int absoluteTime = 0; private int absoluteTime = 0;
@Override public void render(Graphics g) {
public void render(Graphics g) {
g.setColor(color); g.setColor(color);
int temp; int temp;
try{ try{
temp = r.nextInt((int)(0-(absoluteTime/20d))+5); temp = r.nextInt((int)(0-((double)absoluteTime/20d))+5);
}catch(Exception e){ }catch(Exception e){
temp = 0; temp = 0;
} }

View File

@ -22,9 +22,9 @@ public class Shop {
public void tick(){ public void tick(){
if(state == ON && !(animationTime > BOX_WIDTH)){ if(state == ON && !(animationTime > BOX_WIDTH)){
animationTime+=(MAX_ANIMATION_TIME-animationTime)/6; animationTime+=(double)(MAX_ANIMATION_TIME-animationTime)/6;
}else if(state == OFF && !(animationTime < 0)){ }else if(state == OFF && !(animationTime < 0)){
animationTime+=(0-animationTime)/6; animationTime+=(double)(0-animationTime)/6;
} }
if(animationTime < 0.49d){ if(animationTime < 0.49d){
selection = 0; selection = 0;

View File

@ -70,11 +70,10 @@ public class CollisionParticle extends Entity {
this.damage = damage; this.damage = damage;
} }
@Override
public int tick() { public int tick() {
if (life < moveLife) { if (life < moveLife) {
x += Math.cos((angleDeg * Math.PI) / 180d) * speed; x += Math.cos(((double) angleDeg * Math.PI) / 180d) * speed;
y += Math.sin((angleDeg * Math.PI) / 180d) * speed; y += Math.sin(((double) angleDeg * Math.PI) / 180d) * speed;
} }
speed /= DECAY; speed /= DECAY;
if (life > renderLife) if (life > renderLife)
@ -101,7 +100,6 @@ public class CollisionParticle extends Entity {
return 0; return 0;
} }
@Override
public void render(Graphics g) { public void render(Graphics g) {
if (alive) { if (alive) {
g.setColor(color); g.setColor(color);

View File

@ -63,17 +63,16 @@ public class Particle extends Entity{
} else { } else {
color = new Color(rand(0, 256), rand(0, 256), rand(0, 256)); color = new Color(rand(0, 256), rand(0, 256), rand(0, 256));
} }
updateBoundingBox(x, y, size , size); updateBoundingBox((int)x, (int)y, size , size);
} }
private static final double PHI = 1.618033988749894848204586; private static final double PHI = 1.618033988749894848204586;
@Override
public int tick() { public int tick() {
if (life < moveLife) { if (life < moveLife) {
x += Math.cos((angleDeg * Math.PI) / 180d) * speed; x += Math.cos(((double) angleDeg * Math.PI) / 180d) * speed;
y += Math.sin((angleDeg * Math.PI) / 180d) * speed; y += Math.sin(((double) angleDeg * Math.PI) / 180d) * speed;
} }
speed /= PHI; speed /= PHI;
if (life > renderLife) if (life > renderLife)
@ -88,7 +87,6 @@ public class Particle extends Entity{
return 0; return 0;
} }
@Override
public void render(Graphics g) { public void render(Graphics g) {
if (alive) { if (alive) {
g.setColor(color); g.setColor(color);