- Bugs en verbeteringen
This commit is contained in:
@@ -17,9 +17,7 @@ public class PointAnimation extends DrawObject {
|
||||
LinkedList<Integer> puntenGain = new LinkedList<>();
|
||||
LinkedList<Integer> iterations = new LinkedList<>();
|
||||
|
||||
public PointAnimation() {
|
||||
|
||||
}
|
||||
public PointAnimation() { }
|
||||
|
||||
public void enemyDied(Point2D.Double p) {
|
||||
puntenPos.add(new Point2D.Double(p.getX(), p.getY()));
|
||||
@@ -29,13 +27,11 @@ public class PointAnimation extends DrawObject {
|
||||
|
||||
@Override
|
||||
public void draw(Graphics2D g2) {
|
||||
for (int x = 0; x < puntenPos.size(); x++) {
|
||||
Font scoreFont = new Font("OCR A Extended", Font.BOLD, 40);
|
||||
g2.setFont(scoreFont);
|
||||
g2.drawString("" + puntenGain.get(x), (int) puntenPos.get(x).getX(), (int) puntenPos.get(x).getY());
|
||||
for (int x = 0; x < puntenPos.size(); x++) {
|
||||
g2.drawString("" + puntenGain.get(x), (int) puntenPos.get(x).getX(), (int) puntenPos.get(x).getY());
|
||||
|
||||
update(0);
|
||||
}
|
||||
update(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +45,6 @@ public class PointAnimation extends DrawObject {
|
||||
puntenPos.remove(x);
|
||||
iterations.remove(x);
|
||||
puntenGain.remove(x);
|
||||
System.out.println("removed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ public class PlayState extends GameState {
|
||||
Enemy e = enemyIterator.next();
|
||||
if (e.getDistanceFromStart() > Enemy.distanceToOctagon + (sizeOfEnemy * 1.5)) {
|
||||
enemyIterator.remove();
|
||||
lifePoints -= 5;
|
||||
lastScoreChange = -5;
|
||||
lifePoints -= lastScoreChange;
|
||||
sinceScoreChanged = 1;
|
||||
comboMulitplier = 1;
|
||||
enemies_missed++;
|
||||
@@ -137,15 +137,14 @@ public class PlayState extends GameState {
|
||||
infoPanel.updateIPanel();
|
||||
|
||||
if(lifePoints <= 0) { // STERF!
|
||||
currentScore = 0;
|
||||
endGame();
|
||||
currentScore = 0; comboMulitplier = 0; endGame();
|
||||
}
|
||||
|
||||
if(comboMulitplier >= 20) { // '20' hit streak voor bonuspunten
|
||||
comboMulitplier = 1;
|
||||
sinceScoreChanged = 1;
|
||||
currentScore += 500;
|
||||
lastScoreChange = 500;
|
||||
currentScore += lastScoreChange;
|
||||
}
|
||||
|
||||
area.count();
|
||||
@@ -213,11 +212,11 @@ public class PlayState extends GameState {
|
||||
Enemy enemy = enemysInPath.next();
|
||||
if (enemy.getDistanceFromStart() > Enemy.distanceToOctagon || enemy.getDistanceFromStart() > Enemy.distanceToOctagon + sizeOfEnemy) {
|
||||
if (e.getButton().getColor().equals(enemy.getColor())) {
|
||||
currentScore += 5 * comboMulitplier;
|
||||
lastScoreChange = 5 * comboMulitplier;
|
||||
comboMulitplier ++;
|
||||
area.enemyDied((Point2D.Double) enemy.getEnemy().getP1());
|
||||
currentScore += lastScoreChange;
|
||||
comboMulitplier++;
|
||||
sinceScoreChanged = 1;
|
||||
area.enemyDied((Point2D.Double) enemy.getEnemy().getP1());
|
||||
lifePoints = Math.min(lifePoints+10, 100);
|
||||
area.setHitAreaColor(enemy.getColor());
|
||||
area.hit();
|
||||
|
||||
@@ -2,14 +2,7 @@ package model.objects;
|
||||
|
||||
import image.Images;
|
||||
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.Transparency;
|
||||
import java.awt.*;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
@@ -114,6 +107,8 @@ public class PlayArea {
|
||||
oldPathId = pathID;
|
||||
}
|
||||
|
||||
Font scoreFont = new Font("OCR A Extended", Font.BOLD, 40);
|
||||
g2.setFont(scoreFont);
|
||||
pointAnimation.draw(g2);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user