- Title Stage boot animation
- Coin Animation readded - Point Animation added
This commit is contained in:
@@ -11,6 +11,7 @@ import java.awt.Transparency;
|
||||
import java.awt.image.VolatileImage;
|
||||
|
||||
import model.SongHandler;
|
||||
import model.drawObjects.CoinAnimation;
|
||||
import model.gameState.PlayState;
|
||||
|
||||
public class InfoPanel {
|
||||
@@ -20,6 +21,10 @@ public class InfoPanel {
|
||||
private VolatileImage infoPanel;
|
||||
private SongHandler sh;
|
||||
private String time;
|
||||
|
||||
private int tempComboMulitplier;
|
||||
|
||||
private CoinAnimation coinAnimation = new CoinAnimation(125, 300);
|
||||
|
||||
public InfoPanel(int x, int y, SongHandler sh){
|
||||
this.x = x;
|
||||
@@ -80,14 +85,27 @@ public class InfoPanel {
|
||||
// GradientPaint gp = new GradientPaint(300, 0, new Color(200,200,255), 256, 1024, Color.WHITE);
|
||||
// g2.setPaint(gp);
|
||||
// g2.fillRect(x, y, 256, 1024);
|
||||
|
||||
|
||||
g2.setColor(Color.YELLOW);
|
||||
|
||||
g2.setColor(Color.YELLOW);
|
||||
// Controlen of coin animatie nodig is
|
||||
if (!coinAnimation.areWeDoneYet()) {
|
||||
coinAnimation.draw(g2);
|
||||
// Score pas updaten wanneer coin in zijn laatste draw loop zit
|
||||
if (coinAnimation.isLastLoop())
|
||||
tempComboMulitplier = PlayState.comboScore;
|
||||
} else
|
||||
tempComboMulitplier = PlayState.comboScore;
|
||||
|
||||
|
||||
g2.fillRect(25, 1000 - 7 * PlayState.comboScore, 200, 0 + 7 * PlayState.comboScore);
|
||||
g2.dispose();
|
||||
infoPanel.createGraphics();
|
||||
}
|
||||
|
||||
|
||||
public void throwACoin() {
|
||||
coinAnimation.start(); // Teller weer op 1 zetten
|
||||
}
|
||||
|
||||
public void draw(Graphics2D g2){
|
||||
g2.drawImage(infoPanel, 0, 0, 256,1024,null);
|
||||
}
|
||||
|
||||
@@ -2,22 +2,17 @@ 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;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.VolatileImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import model.drawObjects.Enemy;
|
||||
import model.drawObjects.PointAnimation;
|
||||
import model.gameState.PlayState;
|
||||
|
||||
public class PlayArea {
|
||||
@@ -30,6 +25,7 @@ public class PlayArea {
|
||||
private boolean hit = false;
|
||||
private int count = 0,maxCount = 100,pathID = -1;
|
||||
private Stroke stroke = new BasicStroke(5);
|
||||
private PointAnimation pointAnimation = new PointAnimation();
|
||||
|
||||
private Rectangle2D backgroundPlay = new Rectangle2D.Double(256, 0, 1024, 1024);
|
||||
|
||||
@@ -122,8 +118,14 @@ public class PlayArea {
|
||||
g2.setColor(pathColor);
|
||||
g2.draw(paths.get(pathID));
|
||||
}
|
||||
|
||||
Font scoreFont = new Font("OCR A Extended", Font.BOLD, 40);
|
||||
Font tempFont = g2.getFont();
|
||||
g2.setFont(scoreFont);
|
||||
pointAnimation.draw(g2);
|
||||
g2.setFont(tempFont);
|
||||
}
|
||||
|
||||
|
||||
public Line2D getLine(int index){
|
||||
if(index < 0){
|
||||
index = 0;
|
||||
@@ -158,4 +160,6 @@ public class PlayArea {
|
||||
this.pathID = pathID;
|
||||
this.pathColor = pathColor;
|
||||
}
|
||||
|
||||
public void enemyDied(Point2D.Double p) { pointAnimation.enemyDied(p); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user