Skip to content

Commit

Permalink
Damn
Browse files Browse the repository at this point in the history
  • Loading branch information
VVillli committed Sep 23, 2015
1 parent 3ed76e1 commit 26cd4c6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 21 deletions.
Binary file modified bin/gameObjects/Bullet.class
Binary file not shown.
Binary file modified bin/gameObjects/Player.class
Binary file not shown.
Binary file added bin/gameStates/lol.class
Binary file not shown.
Binary file modified bin/gameWindow/GamePanel.class
Binary file not shown.
18 changes: 0 additions & 18 deletions src/gameObjects/Bullet.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,6 @@ public boolean update(){
public void draw(Graphics2D g){
AffineTransform backup = g.getTransform();
AffineTransform trans = new AffineTransform();

double tempAngle = angle;

if(angle > -90 && angle < 0){
tempAngle -= 90;
}

double transX = Math.sin(Math.toRadians(tempAngle))*18.5;
double transY = Math.cos(Math.toRadians(tempAngle))*12;

System.out.println(angle);

if(angle > -90 && angle < 0){
transX = -Math.sin(Math.toRadians(tempAngle))*20;
transY = -Math.cos(Math.toRadians(tempAngle))*30;
}

trans.translate(transX, transY);
trans.rotate(Math.toRadians(angle), x, y);
g.setTransform(trans);
g.drawImage(images[currentImage], x, y, 43, 14, null);
Expand Down
2 changes: 1 addition & 1 deletion src/gameObjects/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void update(int mouseX, int mouseY){
long elapsed = (System.nanoTime() - firingTimer)/1000000;
if(elapsed > firingDelay){
firingTimer = System.nanoTime();
GamePanel.b.add(new Bullet(x, y, angle));
GamePanel.b.add(new Bullet(x - (int)(Math.cos(Math.toRadians(angle))*18), y - (int)(Math.sin(Math.toRadians(angle))*6), angle));
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/gameStates/lol.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package gameStates;

public class lol {

}
4 changes: 2 additions & 2 deletions src/gameWindow/GamePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void gameUpdate(){
}
}

for(int i = 0; i < t.size(); i++){
/*for(int i = 0; i < t.size(); i++){
boolean remove = false;
for(int j = 0; j < b.size(); j++){
Expand All @@ -145,7 +145,7 @@ public void gameUpdate(){
t.remove(i);
i--;
}
}
}*/
}

public void gameRender(){
Expand Down

0 comments on commit 26cd4c6

Please sign in to comment.