Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LevelDefinitions/LevelDefinitions.h@9:96969b1c6bde, 2019-04-24 (annotated)
- Committer:
- joshdavy
- Date:
- Wed Apr 24 10:18:45 2019 +0000
- Revision:
- 9:96969b1c6bde
- Parent:
- 8:21b6d4dbce44
- Child:
- 10:58cf89dd878c
Added win screen aswell as multiple levels.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joshdavy | 8:21b6d4dbce44 | 1 | |
joshdavy | 9:96969b1c6bde | 2 | |
joshdavy | 9:96969b1c6bde | 3 | struct MovingBlockDefinition { |
joshdavy | 9:96969b1c6bde | 4 | int index; |
joshdavy | 9:96969b1c6bde | 5 | bool extending; |
joshdavy | 9:96969b1c6bde | 6 | int distance; |
joshdavy | 9:96969b1c6bde | 7 | }; |
joshdavy | 8:21b6d4dbce44 | 8 | struct LevelDefinition { |
joshdavy | 9:96969b1c6bde | 9 | Block blocks [20]; |
joshdavy | 9:96969b1c6bde | 10 | int number_of_blocks; |
joshdavy | 9:96969b1c6bde | 11 | MovingBlockDefinition moving_blocks [10]; |
joshdavy | 9:96969b1c6bde | 12 | int number_of_moving_blocks ; |
joshdavy | 9:96969b1c6bde | 13 | Vector2D initial_pos; |
joshdavy | 9:96969b1c6bde | 14 | Vector2D goal; |
joshdavy | 9:96969b1c6bde | 15 | }; |
joshdavy | 9:96969b1c6bde | 16 | // const LevelDefinition level_1 = { |
joshdavy | 9:96969b1c6bde | 17 | // // Define Blocks |
joshdavy | 9:96969b1c6bde | 18 | // { |
joshdavy | 9:96969b1c6bde | 19 | // { {5,30},{80,40} }, |
joshdavy | 9:96969b1c6bde | 20 | // { {5,5}, {80,10} }, |
joshdavy | 9:96969b1c6bde | 21 | // { {10,24},{20,34} }, |
joshdavy | 9:96969b1c6bde | 22 | // { {40,24},{44,26} } |
joshdavy | 9:96969b1c6bde | 23 | // }, |
joshdavy | 9:96969b1c6bde | 24 | // // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 25 | // 4, |
joshdavy | 9:96969b1c6bde | 26 | // // Moving Blocks |
joshdavy | 9:96969b1c6bde | 27 | // { |
joshdavy | 9:96969b1c6bde | 28 | // {3,'x',25}, |
joshdavy | 9:96969b1c6bde | 29 | // }, |
joshdavy | 9:96969b1c6bde | 30 | // // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 31 | // 1, |
joshdavy | 9:96969b1c6bde | 32 | // // Initial Position |
joshdavy | 9:96969b1c6bde | 33 | // {32,10}, |
joshdavy | 9:96969b1c6bde | 34 | // // Goal |
joshdavy | 9:96969b1c6bde | 35 | // {70,19} |
joshdavy | 9:96969b1c6bde | 36 | //}; |
joshdavy | 9:96969b1c6bde | 37 | |
joshdavy | 9:96969b1c6bde | 38 | const LevelDefinition level_1 = { |
joshdavy | 9:96969b1c6bde | 39 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 40 | { |
joshdavy | 9:96969b1c6bde | 41 | { {5,30},{80,40} }, |
joshdavy | 9:96969b1c6bde | 42 | { {5,5}, {80,10} } |
joshdavy | 9:96969b1c6bde | 43 | }, |
joshdavy | 9:96969b1c6bde | 44 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 45 | 2, |
joshdavy | 9:96969b1c6bde | 46 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 47 | { |
joshdavy | 9:96969b1c6bde | 48 | |
joshdavy | 9:96969b1c6bde | 49 | }, |
joshdavy | 9:96969b1c6bde | 50 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 51 | 0, |
joshdavy | 9:96969b1c6bde | 52 | // Initial Position |
joshdavy | 9:96969b1c6bde | 53 | {12,10}, |
joshdavy | 9:96969b1c6bde | 54 | // Goal |
joshdavy | 9:96969b1c6bde | 55 | {75,19} |
joshdavy | 9:96969b1c6bde | 56 | }; |
joshdavy | 9:96969b1c6bde | 57 | |
joshdavy | 9:96969b1c6bde | 58 | const LevelDefinition level_2 = { |
joshdavy | 9:96969b1c6bde | 59 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 60 | { |
joshdavy | 9:96969b1c6bde | 61 | { {0,40},{84,45} }, |
joshdavy | 9:96969b1c6bde | 62 | { {5,5}, {80,10} }, |
joshdavy | 9:96969b1c6bde | 63 | { {30,20},{40,40} } |
joshdavy | 9:96969b1c6bde | 64 | }, |
joshdavy | 9:96969b1c6bde | 65 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 66 | 3, |
joshdavy | 9:96969b1c6bde | 67 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 68 | { |
joshdavy | 9:96969b1c6bde | 69 | |
joshdavy | 9:96969b1c6bde | 70 | }, |
joshdavy | 9:96969b1c6bde | 71 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 72 | 0, |
joshdavy | 9:96969b1c6bde | 73 | // Initial Position |
joshdavy | 9:96969b1c6bde | 74 | {12,30}, |
joshdavy | 9:96969b1c6bde | 75 | // Goal |
joshdavy | 9:96969b1c6bde | 76 | {76,29} |
joshdavy | 9:96969b1c6bde | 77 | }; |
joshdavy | 9:96969b1c6bde | 78 | |
joshdavy | 9:96969b1c6bde | 79 | const LevelDefinition level_3 = { |
joshdavy | 9:96969b1c6bde | 80 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 81 | { |
joshdavy | 9:96969b1c6bde | 82 | { {0,40},{84,45} }, |
joshdavy | 9:96969b1c6bde | 83 | { {5,5}, {70,10} }, |
joshdavy | 9:96969b1c6bde | 84 | { {30,20},{40,40} }, |
joshdavy | 9:96969b1c6bde | 85 | { {50,10},{60,30} }, |
joshdavy | 9:96969b1c6bde | 86 | { {70,20},{80,40} } |
joshdavy | 9:96969b1c6bde | 87 | }, |
joshdavy | 9:96969b1c6bde | 88 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 89 | 5, |
joshdavy | 9:96969b1c6bde | 90 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 91 | { |
joshdavy | 9:96969b1c6bde | 92 | |
joshdavy | 9:96969b1c6bde | 93 | }, |
joshdavy | 9:96969b1c6bde | 94 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 95 | 0, |
joshdavy | 9:96969b1c6bde | 96 | // Initial Position |
joshdavy | 9:96969b1c6bde | 97 | {12,30}, |
joshdavy | 9:96969b1c6bde | 98 | // Goal |
joshdavy | 9:96969b1c6bde | 99 | {72,9} |
joshdavy | 9:96969b1c6bde | 100 | }; |
joshdavy | 9:96969b1c6bde | 101 | const LevelDefinition level_4 = { |
joshdavy | 9:96969b1c6bde | 102 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 103 | { |
joshdavy | 9:96969b1c6bde | 104 | { {5,8}, {60,10} }, |
joshdavy | 9:96969b1c6bde | 105 | { {50,10},{60,30} }, |
joshdavy | 9:96969b1c6bde | 106 | { {20,22},{50,30} }, |
joshdavy | 9:96969b1c6bde | 107 | { {1,1}, {5,10} }, |
joshdavy | 9:96969b1c6bde | 108 | { {5,40}, {57,50} } |
joshdavy | 9:96969b1c6bde | 109 | |
joshdavy | 9:96969b1c6bde | 110 | }, |
joshdavy | 9:96969b1c6bde | 111 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 112 | 5, |
joshdavy | 9:96969b1c6bde | 113 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 114 | { |
joshdavy | 9:96969b1c6bde | 115 | |
joshdavy | 9:96969b1c6bde | 116 | }, |
joshdavy | 9:96969b1c6bde | 117 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 118 | 0, |
joshdavy | 9:96969b1c6bde | 119 | // Initial Position |
joshdavy | 9:96969b1c6bde | 120 | {12,0}, |
joshdavy | 9:96969b1c6bde | 121 | // Goal |
joshdavy | 9:96969b1c6bde | 122 | {30,11} |
joshdavy | 9:96969b1c6bde | 123 | }; |
joshdavy | 9:96969b1c6bde | 124 | const LevelDefinition level_5 = { |
joshdavy | 9:96969b1c6bde | 125 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 126 | { |
joshdavy | 9:96969b1c6bde | 127 | { {30,8}, {60,10} }, |
joshdavy | 9:96969b1c6bde | 128 | { {40 ,20 },{ 70 ,22 } }, |
joshdavy | 9:96969b1c6bde | 129 | { {30,30}, {60,32} }, |
joshdavy | 9:96969b1c6bde | 130 | { {0 ,40 },{ 70 ,42 } }, |
joshdavy | 9:96969b1c6bde | 131 | |
joshdavy | 9:96969b1c6bde | 132 | { {70,0},{72,42} }, |
joshdavy | 9:96969b1c6bde | 133 | { {28,0},{30,32} }, |
joshdavy | 9:96969b1c6bde | 134 | |
joshdavy | 9:96969b1c6bde | 135 | {{0,14},{10,40} }, |
joshdavy | 9:96969b1c6bde | 136 | {{0,0},{30,2}}, |
joshdavy | 9:96969b1c6bde | 137 | }, |
joshdavy | 9:96969b1c6bde | 138 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 139 | 8, |
joshdavy | 9:96969b1c6bde | 140 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 141 | { |
joshdavy | 9:96969b1c6bde | 142 | |
joshdavy | 9:96969b1c6bde | 143 | }, |
joshdavy | 9:96969b1c6bde | 144 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 145 | 0, |
joshdavy | 9:96969b1c6bde | 146 | // Initial Position |
joshdavy | 9:96969b1c6bde | 147 | {30,0}, |
joshdavy | 9:96969b1c6bde | 148 | // Goal |
joshdavy | 9:96969b1c6bde | 149 | {1,3} |
joshdavy | 9:96969b1c6bde | 150 | }; |
joshdavy | 9:96969b1c6bde | 151 | |
joshdavy | 9:96969b1c6bde | 152 | const LevelDefinition level_6 = { |
joshdavy | 9:96969b1c6bde | 153 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 154 | { |
joshdavy | 9:96969b1c6bde | 155 | {{1,20},{12,48}}, |
joshdavy | 9:96969b1c6bde | 156 | {{12,26},{22,36}}, |
joshdavy | 9:96969b1c6bde | 157 | {{77,28},{84,48}}, |
joshdavy | 9:96969b1c6bde | 158 | }, |
joshdavy | 9:96969b1c6bde | 159 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 160 | 3, |
joshdavy | 9:96969b1c6bde | 161 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 162 | { |
joshdavy | 9:96969b1c6bde | 163 | {1,false,55}, //55 |
joshdavy | 9:96969b1c6bde | 164 | }, |
joshdavy | 9:96969b1c6bde | 165 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 166 | 1, |
joshdavy | 9:96969b1c6bde | 167 | // Initial Position |
joshdavy | 9:96969b1c6bde | 168 | {0,10}, |
joshdavy | 9:96969b1c6bde | 169 | // Goal |
joshdavy | 9:96969b1c6bde | 170 | {77,17} |
joshdavy | 9:96969b1c6bde | 171 | }; |
joshdavy | 9:96969b1c6bde | 172 | |
joshdavy | 9:96969b1c6bde | 173 | |
joshdavy | 9:96969b1c6bde | 174 | const LevelDefinition level_7 = { |
joshdavy | 9:96969b1c6bde | 175 | // Define Blocks |
joshdavy | 9:96969b1c6bde | 176 | { |
joshdavy | 9:96969b1c6bde | 177 | {{1,34},{12,48}}, |
joshdavy | 9:96969b1c6bde | 178 | {{12,38},{22,48}}, |
joshdavy | 9:96969b1c6bde | 179 | {{32,0},{42,10}}, |
joshdavy | 9:96969b1c6bde | 180 | {{77,24},{84,48}}, |
joshdavy | 9:96969b1c6bde | 181 | }, |
joshdavy | 9:96969b1c6bde | 182 | // Number Of Blocks |
joshdavy | 9:96969b1c6bde | 183 | 4, |
joshdavy | 9:96969b1c6bde | 184 | // Moving Blocks |
joshdavy | 9:96969b1c6bde | 185 | { |
joshdavy | 9:96969b1c6bde | 186 | {1,true,25}, |
joshdavy | 9:96969b1c6bde | 187 | {2,false,25}, |
joshdavy | 9:96969b1c6bde | 188 | }, |
joshdavy | 9:96969b1c6bde | 189 | // Number Of Moving blocks |
joshdavy | 9:96969b1c6bde | 190 | 2, |
joshdavy | 9:96969b1c6bde | 191 | // Initial Position |
joshdavy | 9:96969b1c6bde | 192 | {0,20}, |
joshdavy | 9:96969b1c6bde | 193 | // Goal |
joshdavy | 9:96969b1c6bde | 194 | {77,13} |
joshdavy | 9:96969b1c6bde | 195 | }; |
joshdavy | 9:96969b1c6bde | 196 |