- Duidelijkere score (punten beloning * multiplier)
- Score animatie bij het balletje waar je punten mee scoort
This commit is contained in:
@@ -3,10 +3,12 @@ package model.objects;
|
||||
import image.Images;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.image.VolatileImage;
|
||||
|
||||
import model.SongHandler;
|
||||
import model.drawObjects.CoinAnimation;
|
||||
import model.drawObjects.PointAnimation;
|
||||
import model.gameState.PlayState;
|
||||
|
||||
public class InfoPanel {
|
||||
@@ -21,7 +23,7 @@ public class InfoPanel {
|
||||
|
||||
private CoinAnimation coinAnimation = new CoinAnimation(125, 300);
|
||||
|
||||
|
||||
|
||||
public InfoPanel(int x, int y, SongHandler sh){
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@@ -32,13 +34,6 @@ public class InfoPanel {
|
||||
|
||||
public void updateIPanel() {
|
||||
totalHighscore = "" + PlayState.currentScore;
|
||||
// time = "";
|
||||
// long progress = (sh.getProgress() / 1000);
|
||||
// time = progress%1000 + time;
|
||||
// progress /= 1000;
|
||||
// time = progress%1000 + ":" + time;
|
||||
// progress /= 1000;
|
||||
// time = progress + ":" + time;
|
||||
|
||||
long progress = (sh.getProgress() / 1000);
|
||||
String millis = ((progress) % 1000) + "".length() > 3 ? ("" +((progress) % 1000)).substring(0, 2) : "" + ((progress) % 1000);
|
||||
@@ -70,10 +65,10 @@ public class InfoPanel {
|
||||
g2.fillRect(25, 100, (int)(2 * PlayState.lifePoints), 30);
|
||||
|
||||
// Laatste punten in-/decrease tonen.
|
||||
if (PlayState.sinceScoreChanged < 75 && PlayState.sinceScoreChanged != 0) {
|
||||
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float)(1 - (PlayState.sinceScoreChanged * 0.01))));
|
||||
if (PlayState.sinceScoreChanged < 60 && PlayState.sinceScoreChanged != 0) {
|
||||
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float)(1 - (PlayState.sinceScoreChanged * 0.015))));
|
||||
g2.setColor(Color.RED);
|
||||
g2.drawString("+" + PlayState.lastScoreChange, 205, 40);
|
||||
g2.drawString("+" + PlayState.lastScoreChange, 185, 40);
|
||||
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
|
||||
}
|
||||
|
||||
@@ -94,16 +89,16 @@ public class InfoPanel {
|
||||
coinAnimation.draw(g2);
|
||||
// Score pas updaten wanneer coin in zijn laatste draw loop zit
|
||||
if (coinAnimation.isLastLoop())
|
||||
tempComboScore = PlayState.comboScore;
|
||||
tempComboScore = PlayState.currentScore;
|
||||
} else
|
||||
tempComboScore = PlayState.comboScore;
|
||||
tempComboScore = PlayState.currentScore;
|
||||
|
||||
g2.drawString(sh.getCurrentSongInstance().getDifficulty(), 25, 230);
|
||||
g2.drawString(sh.getCurrentSong().getAuthor(), 25, 260);
|
||||
g2.drawString(time, 25, 290);
|
||||
|
||||
g2.setColor(Color.YELLOW);
|
||||
g2.fillRect(25, 1000 - 7 * tempComboScore, 200, 7 * tempComboScore);
|
||||
g2.fillRect(25, (int)(1000 - PlayState.comboMulitplier * 35), 200, 35 * ((int)PlayState.comboMulitplier));
|
||||
g2.dispose();
|
||||
infoPanel.createGraphics();
|
||||
}
|
||||
@@ -111,7 +106,7 @@ public class InfoPanel {
|
||||
public void throwACoin() {
|
||||
coinAnimation.start(); // Teller weer op 1 zetten
|
||||
}
|
||||
|
||||
|
||||
public void draw(Graphics2D g2){
|
||||
g2.drawImage(infoPanel, 0, 0, 256,1024,null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user