mirror of
https://github.com/guezoloic/racing-game.git
synced 2026-03-31 11:11:38 +00:00
ajout des actions accélérer/rallentir et correction de la condition de dérapage (>=) (Car)
This commit is contained in:
@@ -54,7 +54,10 @@ public class Dashboard extends GameView {
|
||||
*/
|
||||
public Dashboard(Game game, Car car, String title, int width, int height, int x, int y) {
|
||||
super(game, "Dashboard: " + title, width, height, x, y);
|
||||
|
||||
this.car = car;
|
||||
|
||||
|
||||
|
||||
// Fond de la fenêtre = couleur de la voiture
|
||||
frame.setBackground(car.getColor());
|
||||
@@ -64,12 +67,15 @@ public class Dashboard extends GameView {
|
||||
centerPanel.add(infoLabel);
|
||||
centerPanel.add(stateLabel);
|
||||
centerPanel.add(messageLabel);
|
||||
//pour rendre le panel transparent
|
||||
centerPanel.setOpaque(false);
|
||||
|
||||
// ----- Partie boutons -----
|
||||
JPanel buttonPanel = new JPanel(new GridLayout(1, 3));
|
||||
buttonPanel.add(decelerateButton);
|
||||
buttonPanel.add(pauseButton);
|
||||
buttonPanel.add(accelerateButton);
|
||||
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
add(centerPanel, BorderLayout.CENTER);
|
||||
|
||||
Reference in New Issue
Block a user