Basic reveal mechanic
This commit is contained in:
parent
7e634917bf
commit
4639c22025
8 changed files with 71 additions and 8 deletions
|
|
@ -30,6 +30,13 @@ export function isColliding(
|
|||
);
|
||||
}
|
||||
|
||||
export function shapeCollision(
|
||||
firstShape: { x: number; y: number; w: number },
|
||||
secondShape: { x: number; y: number; w: number }
|
||||
) {
|
||||
return mp5.dist(firstShape.x, firstShape.y, secondShape.x, secondShape.y) < secondShape.w - 150;
|
||||
}
|
||||
|
||||
export function generateEdgeCoords(existingEdges: Edge[]): Coordinates {
|
||||
let newCoords: Coordinates;
|
||||
const existingCoordinates = existingEdges.map(({ x, y }) => ({ x, y }));
|
||||
|
|
|
|||
Reference in a new issue