use of src.model.board.LineWall in project Labyrinthe3d by FauconFan.
the class MapIntro7 method buildOneSquareLabyrinthe.
private RectMaze buildOneSquareLabyrinthe() {
RectMaze rl;
ArrayList<LineWall> listWalls;
listWalls = new ArrayList<>();
listWalls.add(new LineWall(0, 0, 0, 7));
listWalls.add(new LineWall(size_y, 7, size_y, 0));
listWalls.add(new LineWall(0, 0, size_y, 0));
listWalls.add(new LineWall(0, 7, size_y, 7));
listWalls.add(new LineWall(1, 0, 1, 2));
listWalls.add(new LineWall(1, 3, 1, 6));
listWalls.add(new LineWall(2, 1, 2, 3));
listWalls.add(new LineWall(2, 4, 2, 6));
listWalls.add(new LineWall(2, 4, 3, 4));
listWalls.add(new LineWall(3, 4, 3, 5));
listWalls.add(new LineWall(3, 2, 3, 3));
listWalls.add(new LineWall(3, 3, size_y - 3, 3));
listWalls.add(new LineWall(4, 4, size_y - 3, 4));
listWalls.add(new LineWall(size_y - 2, 5, size_y - 2, 2));
listWalls.add(new LineWall(size_y - 2, 2, 3, 2));
listWalls.add(new LineWall(1, 6, size_y - 1, 6));
listWalls.add(new LineWall(1, 3, 2, 3));
listWalls.add(new LineWall(size_y - 1, 2, size_y - 1, 6));
listWalls.add(new LineWall(size_y, 1, 2, 1));
listWalls.add(new LineWall(size_y - 2, 5, 3, 5));
rl = new RectMaze(new ContentMazeEgg(new Case[0], listWalls.toArray(new LineWall[0])), size_y, 7);
return (rl);
}
use of src.model.board.LineWall in project Labyrinthe3d by FauconFan.
the class MiniMap method makeLineWalls.
private Group makeLineWalls(LineWall[] lineWalls) {
final Group res = new Group();
res.getTransforms().addAll(sc2d);
AmbientLight am = new AmbientLight(Color.WHITE);
res.getChildren().add(am);
for (LineWall l : lineWalls) {
Line li = new Line(l.getX1(), -l.getY1(), l.getX2(), -l.getY2());
li.setFill(Color.BLUE);
li.setStrokeWidth(0.1f);
res.getChildren().add(li);
}
return (res);
}
use of src.model.board.LineWall in project Labyrinthe3d by FauconFan.
the class CollisionsXYManager method putClosestWall.
/**
* Cherche le mur le plus proche qui gène le déplacement.
*/
private void putClosestWall() {
float coefProp;
float positionEff;
for (LineWall lw : this.walls) {
FloatVector[][] effectWalls = lw.effWalls(this.p.getPosX(), this.p.getPosY());
for (int i = 0; i < effectWalls.length; i++) {
boolean horizontalWall = CollisionsXYManager.effectWallIsHorizontal(effectWalls[i]);
if (!this.splitMove[0].isCollinearTo((effectWalls[i][1].getX() - effectWalls[i][0].getX()), (effectWalls[i][1].getY() - effectWalls[i][0].getY()))) {
if (horizontalWall) {
positionEff = (this.p.getPosY() < effectWalls[i][0].getY()) ? -1 : 1;
coefProp = (effectWalls[i][0].getY() + this.p.getHitBoxCircle() * positionEff - this.p.getPosY()) / this.splitMove[0].getY();
} else {
positionEff = (this.p.getPosX() < effectWalls[i][0].getX()) ? -1 : 1;
coefProp = (effectWalls[i][0].getX() + this.p.getHitBoxCircle() * positionEff - this.p.getPosX()) / this.splitMove[0].getX();
}
if ((coefProp < this.coefPropMin && coefProp < 1 && this.isConsideredWall(coefProp, effectWalls[i], horizontalWall)) && (0 < coefProp || (Math.abs(coefProp) < 10e-4f && ((horizontalWall && this.splitMove[0].getY() * positionEff < 0) || (!horizontalWall && this.splitMove[0].getX() * positionEff < 0))))) {
this.coefPropMin = coefProp;
this.closestWall = effectWalls[i];
}
}
}
}
}
Aggregations