help line added, helps where the closest enemy is
This commit is contained in:
@@ -18,8 +18,6 @@ public class Enemy extends DrawObject {
|
||||
public Enemy(int pathID,int lengthOfEnemy,Color c,Path path){
|
||||
super();
|
||||
this.length = lengthOfEnemy;
|
||||
// System.out.println(this.length*this.length/2);
|
||||
// System.out.println(Math.sqrt(Math.pow(this.length,2)/2));
|
||||
lengthOf1Side = Math.sqrt(Math.pow(lengthOfEnemy,2)/2);
|
||||
this.c = c;
|
||||
this.index = pathID;
|
||||
@@ -65,7 +63,6 @@ public class Enemy extends DrawObject {
|
||||
endY += beginY;
|
||||
|
||||
enemy = new Line2D.Double(beginX, beginY, endX, endY);
|
||||
// System.out.println("Enemy added on path: "+pathID);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,8 +86,7 @@ public class Enemy extends DrawObject {
|
||||
angleX = Math.cos(Math.toRadians(45))*distanceFromStart;
|
||||
angleY = Math.sin(Math.toRadians(45))*distanceFromStart;
|
||||
|
||||
// System.out.println(Math.toRadians(45)*distanceFromStart);
|
||||
// System.out.println(angleX+" - "+angleY);
|
||||
|
||||
|
||||
switch(index){
|
||||
case 0:
|
||||
@@ -98,7 +94,6 @@ public class Enemy extends DrawObject {
|
||||
y2 = y1 - length;
|
||||
break;
|
||||
case 1:
|
||||
// x1 -= speedX;
|
||||
x1 = path.getX1() - angleX;
|
||||
x2 = x1 + lengthOf1Side;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user