voilà, le graphique est réglé, l'ascenseur va de 0 à 1 (à précision flottante près) et graphiquement - problème de queue réglée, on est plus bloqués

This commit is contained in:
DylanVsn
2019-10-17 22:04:43 +02:00
parent f53827dd4f
commit 8475ff4ee0
3 changed files with 53 additions and 32 deletions

View File

@ -45,7 +45,10 @@ class ElevatorCanvas extends JPanel {
else {
g.setColor(Color.BLACK);
}
g.fillRect(0, 200 - (int) Math.floor(elevator.getHeight() * 200) - HEIGHT, WIDTH, HEIGHT);
// g.fillRect(0, 200 - (int) Math.floor(elevator.getHeight() * 200) - HEIGHT, WIDTH, HEIGHT);
// System.out.println("elevator height:" + elevator.getHeight());
g.fillRect(0, 200 - HEIGHT - (int) ((200 - HEIGHT) * elevator.getHeight()), WIDTH, HEIGHT);
Toolkit.getDefaultToolkit().sync();
}
}