feat: fenetre principal et dashboard pret

This commit is contained in:
2025-11-09 13:59:03 +01:00
parent ea260adbc7
commit da8dccc72f
4 changed files with 45 additions and 11 deletions

View File

@@ -3,13 +3,40 @@ import java.awt.Color;
public class Main {
public static void main(String[] args) throws InterruptedException
{
Game game = new Game.Builder()
.defaultMap()
.setPlayers(3)
.build();
// Game game = new Game.Builder()
// .defaultMap()
// .setPlayers(3)
// .build();
Integer[][] map = new Integer[][]
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -1, -1, 5, 0 },
{ 0, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 0, 0, -1, 0, 0, -1, 0 },
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0 },
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0 },
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -1, -1, 2, 0, 0, -1, 0 },
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 },
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 },
{ 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -3, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
};
game.run();
Map m = Map.fromInts(map);
// game.run();
// Dashboard d = new Dashboard(new Car(10, new State()), "Voiture 1", Color.BLUE, 500, 500, 10, 10);
// Dashboard d = new Dashboard(new Car(10, new State()), "Voiture 1", null, Color.BLUE, 500, 500, 10, 10);
Car[] cars = new Car[] { new Car(m.getPathSize(), new State(), Color.PINK)};
System.out.println(cars[0].getLoop());
Track t = new Track(m, cars, null, 1080, 512, 0, 0);
Dashboard d = new Dashboard(cars[0], null, () -> true, 300, 300, 0, 0);
while(cars[0].getRound() < 1)
{
cars[0].run();
GameView.update();
Thread.sleep(500);
}
}
}