mirror of
https://github.com/guezoloic/racing-game.git
synced 2026-03-31 11:11:38 +00:00
feat: ajout multiple fonction et factorisation
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user