MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / constructor

Method constructor

Line.js:16–34  ·  view source on GitHub ↗
(x1, y1, x2, y2)

Source from the content-addressed store, hash-verified

14
15class Line {
16 constructor(x1, y1, x2, y2) {
17 this.x1 = x1;
18 this.x2 = x2;
19 this.y1 = y1;
20 this.y2 = y2;
21 this.isHorizontal = y1 === y2;
22 this.isVertical = x1 === x2;
23
24
25 this.isDiagonal = !(this.isHorizontal || this.isVertical)
26 this.ensurePointsAreInOrder();
27
28
29 this.midPoint = createVector((x1+x2)/2,(y1+y2)/2);
30
31
32 this.diagonalCollisionInfo = new DiagonalCollisionInfo();
33
34 }
35
36
37 Show() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected