MCPcopy Create free account
hub / github.com/code100x/plinkoo / createObstacles

Function createObstacles

frontend/src/game/objects.ts:38–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38export const createObstacles = (): Obstacle[] => {
39 const obstacles: Obstacle[] = [];
40 const rows = 18;
41 for (let row = 2; row < rows; row++) {
42 const numObstacles = row + 1;
43 const y = 0 + row * 35;
44 const spacing = 36;
45 for (let col = 0; col < numObstacles; col++) {
46 const x = WIDTH / 2 - spacing * (row / 2 - col);
47 obstacles.push({x: pad(x), y: pad(y), radius: obstacleRadius });
48 }
49 }
50 return obstacles;
51}
52
53export const createSinks = (): Sink[] => {
54 const sinks = [];

Callers 1

constructorMethod · 0.90

Calls 1

padFunction · 0.90

Tested by

no test coverage detected