mirror of
https://github.com/guezoloic/L3-racing-game.git
synced 2026-03-31 04:11:33 +00:00
37 lines
1.7 KiB
Java
37 lines
1.7 KiB
Java
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();
|
|
}
|
|
} |