help line added, helps where the closest enemy is

This commit is contained in:
Remco
2015-06-11 13:00:51 +02:00
parent 69bc3c2bee
commit 6f17124e02
3 changed files with 29 additions and 15 deletions
+15 -7
View File
@@ -21,10 +21,10 @@ public class PlayArea {
public List<Path> paths;
private Polygon innerHitAreaBorder,outsideHitAreaBorder;
private GeneralPath hitArea;
private Color hitAreaColor;
private Color hitAreaColor,pathColor = null;
private VolatileImage background;
private boolean hit = false;
private int count = 0,maxCount = 100;
private int count = 0,maxCount = 100,pathID = -1;
public PlayArea(double xToRight,double heightOfGameScreen,double widthOfGameScreen, int sizeOctagon) {
super();
@@ -99,11 +99,14 @@ public class PlayArea {
g2.drawImage(background, 0, 0, 1280, 1024, null);
if(hit){
g2.setColor(hitAreaColor);
g2.fill(hitArea);
}
if(count == maxCount){
hit = false;
g2.fill(hitArea);
if(count == maxCount){
hit = false;
}
}
if(pathID >= 0 && pathColor != null){
g2.setColor(pathColor);
g2.draw(paths.get(pathID));
}
}
@@ -136,4 +139,9 @@ public class PlayArea {
hitAreaColor = new Color(hitAreaColor.getRed(),hitAreaColor.getGreen(),hitAreaColor.getBlue(),255-(255*count)/maxCount);
}
}
public void pathPainted(int pathID,Color pathColor){
this.pathID = pathID;
this.pathColor = pathColor;
}
}