| 96 | } |
| 97 | |
| 98 | void ObstacleGenerator::GenMedium(Obstacle* result) { |
| 99 | int n = Random(3); |
| 100 | int i; |
| 101 | switch (n) { |
| 102 | case 0: |
| 103 | i = Random(1, OBS_GRID_SIZE - 1); // i is the row of the bonus |
| 104 | FillRow(result, i + 1); |
| 105 | FillRow(result, i - 1); |
| 106 | break; |
| 107 | case 1: |
| 108 | i = Random(1, OBS_GRID_SIZE - 1); // i is the column of the bonus |
| 109 | FillCol(result, i - 1); |
| 110 | FillCol(result, i + 1); |
| 111 | break; |
| 112 | default: |
| 113 | i = Random(1, OBS_GRID_SIZE - 1); // i is the column of the bonus |
| 114 | FillRow(result, i); |
| 115 | FillCol(result, i); |
| 116 | break; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | void ObstacleGenerator::GenIntermediate(Obstacle* result) { |
| 121 | int n = Random(3); |