Page 175 - MDP2022-3
P. 175
nowSelected = trackList.size() -1;
else
nowSelected--;
selectTrack(nowSelected);
}
public void selectRight(){
if(nowSelected == trackList.size() - 1)
nowSelected = 0;
else
nowSelected++;
selectTrack(nowSelected);
}
public void gameStartSum() {
gameStart(nowSelected , "Easy");
}
public void gameStart(int nowSelected , String difficulty) {
if(selectedMusic != null)
selectedMusic.close();
isMainScreen = false;
isRankScreen = false;
leftButton.setVisible(false);
rightButton.setVisible(false);
easyButton.setVisible(false);
background = new ImageIcon(Main.class.getResource("../images/" +
trackList.get(nowSelected).getGameImage())).getImage();
backButton.setVisible(true);
isGameScreen = true;
game = new Game(trackList.get(nowSelected).getGameTitleName() , difficulty ,
trackList.get(nowSelected).getGameMusic());
game.start();
setFocusable(true);
}
public void backMain() {
isMainScreen = true;
isRankScreen = false;
leftButton.setVisible(true);
rightButton.setVisible(true);
easyButton.setVisible(true);
background = new
ImageIcon(Main.class.getResource("../images/mainBackground.png")).getImage();
backButton.setVisible(false);