Skip to content
Snippets Groups Projects
Commit e33f3a7c authored by Jasper Leung's avatar Jasper Leung
Browse files

different UI notification for each collision type

parent 7c9ee521
No related branches found
No related tags found
No related merge requests found
......@@ -31,3 +31,11 @@
/EndGameDisplay.class
/Helper.class
/Timeout.class
/EndGameDisplay$1.class
/EndGameDisplay$2.class
/GameDisplay$1.class
/MainMenuDisplay$1$1$1.class
/MainMenuDisplay$1$1.class
/MainMenuDisplay$2$1.class
/MainMenuDisplay$3$1.class
/ScoreDisplay$1.class
......@@ -42,6 +42,7 @@ public class ThreadsController extends Thread{
private boolean speedMode = false;
private boolean timeMode = false;
private boolean autoReplayMode = false;
private boolean wallCollision = false;
public static boolean paused;
......@@ -233,6 +234,7 @@ public class ThreadsController extends Thread{
// Wall collision
if (checkWallCollision()) {
wallCollision = true;
stopTheGame();
return true;
}
......@@ -369,7 +371,7 @@ public class ThreadsController extends Thread{
GameDisplay.timerLabel.setText("");
GameDisplay.speedLabel.setText("Speed: " + (105 - START_SPEED));
GameDisplay.modeLabel.setText("Modes: " + modes);
wallCollision = false;
init(new Tuple(3, 10));
}
......@@ -425,13 +427,22 @@ public class ThreadsController extends Thread{
boolean checkHighest=false;
for (Score i : scores) {
if(checkHighest==false) {
GameDisplay.scoreLabel.setFont(new Font("Serif", Font.PLAIN, 50));
GameDisplay.timerLabel.setText("");
GameDisplay.speedLabel.setText("");
GameDisplay.modeLabel.setText("");
if(currScore == i.getScore()) {
GameDisplay.scoreLabel.setFont(new Font("Serif", Font.PLAIN, 30));
GameDisplay.scoreLabel.setText("NEW HIGH SCORE: " + i.getScore());
GameDisplay.scoreLabel.setForeground(new Color(139, 181, 181));
GameDisplay.scoreLabel.setText("NEW HIGH SCORE: " + i.getScore());
}
else {
GameDisplay.scoreLabel.setForeground(Color.RED);
GameDisplay.timerLabel.setText("");
GameDisplay.speedLabel.setText("");
GameDisplay.modeLabel.setText("");
if (wallCollision) {
GameDisplay.scoreLabel.setText("WALL COLLISION");
}
else {
GameDisplay.scoreLabel.setText("COLLISION");
}
}
}
checkHighest = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment