mirror of
https://github.com/guezoloic/racing-game.git
synced 2026-03-28 18:03:50 +00:00
fix(Map.java): ajout bordure a getPathMap
This commit is contained in:
@@ -20,17 +20,17 @@ public class Main {
|
|||||||
Map m = Map.fromInts(map);
|
Map m = Map.fromInts(map);
|
||||||
|
|
||||||
Game game = new Game.Builder()
|
Game game = new Game.Builder()
|
||||||
.addCar(new Game.CarInfo("Voiture à LUWIK", Color.BLUE))
|
.addCar(new Game.CarInfo("Voiture à LUWIK", Color.BLUE))
|
||||||
.addCar(new Game.CarInfo("Voiture à CHARAZADE", Color.PINK))
|
.addCar(new Game.CarInfo("Voiture à CHARAZADE", Color.PINK))
|
||||||
.addCar(new Game.CarInfo("Voiture de UPEC", Color.RED))
|
.addCar(new Game.CarInfo("Voiture de UPEC", Color.RED))
|
||||||
.setTime(1000)
|
.setTime(1000)
|
||||||
.setMap(m)
|
.setMap(m)
|
||||||
.addVisual(Dashboard.class, "Voiture à LUWIK", 300, 200, 1000, 0)
|
.addVisual(Dashboard.class, "Voiture à LUWIK", 300, 200, 1000, 0)
|
||||||
.addVisual(Dashboard.class, "Voiture à CHARAZADE", 300, 200, 1000, 200)
|
.addVisual(Dashboard.class, "Voiture à CHARAZADE", 300, 200, 1000, 200)
|
||||||
.addVisual(Dashboard.class, "Voiture de UPEC", 300, 200, 1000, 400)
|
.addVisual(Dashboard.class, "Voiture de UPEC", 300, 200, 1000, 400)
|
||||||
.addVisual(Track.class, "Piste Formule 1", 1000, 500, 1, 1)
|
.addVisual(Track.class, "Piste Formule 1", 1000, 500, 1, 1)
|
||||||
.addVisual(Rankboard.class, "Score", 200, 200, 0, 510)
|
.addVisual(Rankboard.class, "Score", 200, 200, 0, 510)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
game.run();
|
game.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,7 +274,9 @@ public class Map
|
|||||||
*/
|
*/
|
||||||
public Point getPath(int i)
|
public Point getPath(int i)
|
||||||
{
|
{
|
||||||
return this.pathMap.get(i);
|
if (i < 0) return this.pathMap.getFirst();
|
||||||
|
else if (i >= this.pathMap.size()) return this.pathMap.getLast();
|
||||||
|
else return this.pathMap.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user