-
This commit is contained in:
@@ -4,29 +4,34 @@ import model.gameState.PlayState;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class PointAnimation extends DrawObject {
|
||||
|
||||
LinkedList<Point2D.Double> puntenPos = new LinkedList<>();
|
||||
LinkedList<Integer> puntenGain = new LinkedList<>();
|
||||
LinkedList<Integer> iterations = new LinkedList<>();
|
||||
ArrayList<Point2D.Double> puntenPos = new ArrayList<>();
|
||||
ArrayList<Integer> puntenGain = new ArrayList<>();
|
||||
ArrayList<Integer> iterations = new ArrayList<>();
|
||||
ArrayList<Color> colors = new ArrayList<>();
|
||||
|
||||
public static double LastPointIncrement = 0;
|
||||
|
||||
public PointAnimation() { }
|
||||
|
||||
public void enemyDied(Point2D.Double p) {
|
||||
public void enemyDied(Point2D.Double p, Color c) {
|
||||
puntenPos.add(new Point2D.Double(p.getX(), p.getY()));
|
||||
puntenGain.add((int)LastPointIncrement);
|
||||
iterations.add(0);
|
||||
colors.add(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2) {
|
||||
for (int x = 0; x < puntenPos.size(); x++) {
|
||||
Color oldColor = g2.getColor();
|
||||
g2.setColor(colors.get(x));
|
||||
g2.drawString("" + puntenGain.get(x), (int) puntenPos.get(x).getX(), (int) puntenPos.get(x).getY());
|
||||
|
||||
g2.setColor(oldColor);
|
||||
update(0);
|
||||
}
|
||||
}
|
||||
@@ -42,6 +47,7 @@ public class PointAnimation extends DrawObject {
|
||||
puntenPos.remove(x);
|
||||
iterations.remove(x);
|
||||
puntenGain.remove(x);
|
||||
colors.remove(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user