From 864b6efa520df004beba8495bb3ad3b9344e3d4f Mon Sep 17 00:00:00 2001 From: Bilel Bghiel Date: Fri, 19 Jun 2015 13:50:26 +0200 Subject: [PATCH] fixes --- model/drawObjects/CoinAnimation.java | 5 ++-- model/gameState/MenuState.java | 44 ++++++++++++---------------- model/objects/InfoPanel.java | 3 +- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/model/drawObjects/CoinAnimation.java b/model/drawObjects/CoinAnimation.java index bc4a577..5bd4c4c 100644 --- a/model/drawObjects/CoinAnimation.java +++ b/model/drawObjects/CoinAnimation.java @@ -38,7 +38,6 @@ public class CoinAnimation extends DrawObject { g2.setColor(new Color(255, 255, 0)); // GEEL g2.draw(coinShape); // MUNTJE TEKENEN g2.fill(coinShape); - } // Wordt na elke paint aangeroepen @@ -53,7 +52,7 @@ public class CoinAnimation extends DrawObject { // Coin omlaag verschuiven doordat Y * loops omlaag gaat. // Per frame verschuift het balletje delta 10 op Y-as. try { - coinShape.setFrame(coinSetPoint.getX(), coinSetPoint.getY() + (1000 - 7 * PlayState.comboScore) / 50 * timerLoops, + coinShape.setFrame(coinSetPoint.getX(), coinSetPoint.getY() + (1000 - 7 * PlayState.comboScore) / 20 * timerLoops, coinShape.getWidth(), coinShape.getHeight()); } catch (ArithmeticException a) { a.printStackTrace(); } @@ -62,7 +61,7 @@ public class CoinAnimation extends DrawObject { // Zijn we al begonnen/klaar? public boolean areWeDoneYet() { - if (timerLoops > 49 || timerLoops == 0) { + if (timerLoops > 19 || timerLoops == 0) { timerLoops = 0; return true; } diff --git a/model/gameState/MenuState.java b/model/gameState/MenuState.java index 2cb6f10..b9e45eb 100644 --- a/model/gameState/MenuState.java +++ b/model/gameState/MenuState.java @@ -39,29 +39,29 @@ public class MenuState extends GameState { private ArrayList buttons2; private int selected, oldselected; private List songs; - SQLConnector sql; + private SQLConnector sql; private int animationcounter; private boolean subscreen, startanimation; private VolatileImage mainScreenBackground, subScreenBackground, subScreenForeground; - - int yPosDiffButton = 900; + private int difSelect=0, oldDifSelect = -1; - Font textFont = new Font("OCR A Extended", Font.BOLD, 50); - Font textFontSmall = new Font("OCR A Extended", Font.BOLD, 15); + + Font textFont = new Font("OCR A Extended", Font.BOLD, 50); + Font textFontSmall = new Font("OCR A Extended", Font.BOLD, 15); + BufferedImage aanwijzers = Images.getImage(ImageType.aanwijzers); - int index = 0; - - - - int kleurButton1 = 0; - int kleurButton2 = 1; - int kleurButton3 = 2; - int kleurButton4 = 3; - int kleurButton5 = 4; - - - + + private int index = 0, + getDifSelect = 0, + getOldDifSelect = -1, + yPosDiffButton = 900, + kleurButton1 = 0, + kleurButton2 = 1, + kleurButton3 = 2, + kleurButton4 = 3, + kleurButton5 = 4; + public MenuState(GameStateManager gsm, SongHandler sh, SQLConnector sql) { super(gsm, sh, sql); buttons = new ArrayList(); @@ -96,17 +96,13 @@ public class MenuState extends GameState { ButtonHandler.getButton(2).setColor(GameModel.colors[2]); generateSubScreenForeground(); } - else - { + else { ButtonHandler.getButton(1).setColor(GameModel.colors[0]); - + ButtonHandler.getButton(5).setColor(GameModel.colors[1]); ButtonHandler.getButton(6).setColor(GameModel.colors[4]); JoystickHandler.REPEAT = true; } - - - } @Override @@ -245,8 +241,6 @@ public class MenuState extends GameState { kleurButton5++; kleurButton5 %= 6; - - }else if(e.getJoystick().getPos() == Joystick.Position.UP){ selected--; diff --git a/model/objects/InfoPanel.java b/model/objects/InfoPanel.java index 8e16157..8ee5db0 100644 --- a/model/objects/InfoPanel.java +++ b/model/objects/InfoPanel.java @@ -89,11 +89,12 @@ public class InfoPanel { tempComboScore = PlayState.comboScore; } else tempComboScore = PlayState.comboScore; + g2.drawString(sh.getCurrentSongInstance().getDifficulty(), 25, 230); g2.drawString(sh.getCurrentSong().getAuthor(), 25, 260); g2.drawString(time, 25, 290); - g2.setColor(Color.BLACK); + g2.setColor(Color.YELLOW); g2.fillRect(25, 1000 - 7 * tempComboScore, 200, 7 * tempComboScore); g2.dispose(); infoPanel.createGraphics();