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.
Diff: LevelDefinitions/LevelDefinitions.h
- Revision:
- 9:96969b1c6bde
- Parent:
- 8:21b6d4dbce44
- Child:
- 10:58cf89dd878c
diff -r 21b6d4dbce44 -r 96969b1c6bde LevelDefinitions/LevelDefinitions.h
--- a/LevelDefinitions/LevelDefinitions.h Fri Apr 19 17:54:09 2019 +0000
+++ b/LevelDefinitions/LevelDefinitions.h Wed Apr 24 10:18:45 2019 +0000
@@ -1,5 +1,196 @@
+
+struct MovingBlockDefinition {
+ int index;
+ bool extending;
+ int distance;
+};
struct LevelDefinition {
- Block blocks []
- int number_of_blocks
-
\ No newline at end of file
+ Block blocks [20];
+ int number_of_blocks;
+ MovingBlockDefinition moving_blocks [10];
+ int number_of_moving_blocks ;
+ Vector2D initial_pos;
+ Vector2D goal;
+};
+// const LevelDefinition level_1 = {
+// // Define Blocks
+// {
+// { {5,30},{80,40} },
+// { {5,5}, {80,10} },
+// { {10,24},{20,34} },
+// { {40,24},{44,26} }
+// },
+// // Number Of Blocks
+// 4,
+// // Moving Blocks
+// {
+// {3,'x',25},
+// },
+// // Number Of Moving blocks
+// 1,
+// // Initial Position
+// {32,10},
+// // Goal
+// {70,19}
+//};
+
+ const LevelDefinition level_1 = {
+ // Define Blocks
+ {
+ { {5,30},{80,40} },
+ { {5,5}, {80,10} }
+ },
+ // Number Of Blocks
+ 2,
+ // Moving Blocks
+ {
+
+ },
+ // Number Of Moving blocks
+ 0,
+ // Initial Position
+ {12,10},
+ // Goal
+ {75,19}
+};
+
+ const LevelDefinition level_2 = {
+ // Define Blocks
+ {
+ { {0,40},{84,45} },
+ { {5,5}, {80,10} },
+ { {30,20},{40,40} }
+ },
+ // Number Of Blocks
+ 3,
+ // Moving Blocks
+ {
+
+ },
+ // Number Of Moving blocks
+ 0,
+ // Initial Position
+ {12,30},
+ // Goal
+ {76,29}
+};
+
+ const LevelDefinition level_3 = {
+ // Define Blocks
+ {
+ { {0,40},{84,45} },
+ { {5,5}, {70,10} },
+ { {30,20},{40,40} },
+ { {50,10},{60,30} },
+ { {70,20},{80,40} }
+ },
+ // Number Of Blocks
+ 5,
+ // Moving Blocks
+ {
+
+ },
+ // Number Of Moving blocks
+ 0,
+ // Initial Position
+ {12,30},
+ // Goal
+ {72,9}
+};
+ const LevelDefinition level_4 = {
+ // Define Blocks
+ {
+ { {5,8}, {60,10} },
+ { {50,10},{60,30} },
+ { {20,22},{50,30} },
+ { {1,1}, {5,10} },
+ { {5,40}, {57,50} }
+
+ },
+ // Number Of Blocks
+ 5,
+ // Moving Blocks
+ {
+
+ },
+ // Number Of Moving blocks
+ 0,
+ // Initial Position
+ {12,0},
+ // Goal
+ {30,11}
+};
+ const LevelDefinition level_5 = {
+ // Define Blocks
+ {
+ { {30,8}, {60,10} },
+ { {40 ,20 },{ 70 ,22 } },
+ { {30,30}, {60,32} },
+ { {0 ,40 },{ 70 ,42 } },
+
+ { {70,0},{72,42} },
+ { {28,0},{30,32} },
+
+ {{0,14},{10,40} },
+ {{0,0},{30,2}},
+ },
+ // Number Of Blocks
+ 8,
+ // Moving Blocks
+ {
+
+ },
+ // Number Of Moving blocks
+ 0,
+ // Initial Position
+ {30,0},
+ // Goal
+ {1,3}
+};
+
+ const LevelDefinition level_6 = {
+ // Define Blocks
+ {
+ {{1,20},{12,48}},
+ {{12,26},{22,36}},
+ {{77,28},{84,48}},
+ },
+ // Number Of Blocks
+ 3,
+ // Moving Blocks
+ {
+ {1,false,55}, //55
+ },
+ // Number Of Moving blocks
+ 1,
+ // Initial Position
+ {0,10},
+ // Goal
+ {77,17}
+};
+
+
+ const LevelDefinition level_7 = {
+ // Define Blocks
+ {
+ {{1,34},{12,48}},
+ {{12,38},{22,48}},
+ {{32,0},{42,10}},
+ {{77,24},{84,48}},
+ },
+ // Number Of Blocks
+ 4,
+ // Moving Blocks
+ {
+ {1,true,25},
+ {2,false,25},
+ },
+ // Number Of Moving blocks
+ 2,
+ // Initial Position
+ {0,20},
+ // Goal
+ {77,13}
+};
+