()
| 36 | } |
| 37 | |
| 38 | export 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 | |
| 53 | export const createSinks = (): Sink[] => { |
| 54 | const sinks = []; |