feat: ajout multiple fonction et factorisation

This commit is contained in:
2025-12-10 20:44:01 +01:00
parent 21640b312a
commit 82d360b1d9
6 changed files with 527 additions and 407 deletions

View File

@@ -1,37 +1,7 @@
import java.awt.Color;
public class Main {
public static void main(String[] args) throws InterruptedException
{
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 },
};
Map m = Map.fromInts(map);
Game game = new Game.Builder()
.addCar(new Game.CarInfo("Voiture à LUWIK", Color.BLUE))
.addCar(new Game.CarInfo("Voiture à CHARAZADE", Color.PINK))
.addCar(new Game.CarInfo("Voiture de UPEC", Color.RED))
.setTime(1000)
.setMap(m)
.addVisual(Dashboard.class, "Voiture à LUWIK", 300, 200, 1000, 0)
.addVisual(Dashboard.class, "Voiture à CHARAZADE", 300, 200, 1000, 200)
.addVisual(Dashboard.class, "Voiture de UPEC", 300, 200, 1000, 400)
.addVisual(Track.class, "Piste Formule 1", 1000, 500, 1, 1)
.addVisual(Rankboard.class, "Score", 200, 200, 0, 510)
.build();
game.run();
}
public static void main(String[] args) throws InterruptedException {
Map map = Game.GameFactory.defaultMap();
Game game = Game.GameFactory.defaultGame(map);
game.run();
}
}