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.
Maze/Maze.cpp@25:28c57be06933, 2018-05-08 (annotated)
- Committer:
- ahmedhedait
- Date:
- Tue May 08 14:20:24 2018 +0000
- Revision:
- 25:28c57be06933
- Parent:
- 19:c6ebd1394bda
I have re-adjusted my last comments so the code to be completed.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ahmedhedait | 17:68d4b4095d80 | 1 | #include "Maze.h" |
ahmedhedait | 17:68d4b4095d80 | 2 | |
ahmedhedait | 17:68d4b4095d80 | 3 | // nothing doing in the constructor and destructor |
ahmedhedait | 17:68d4b4095d80 | 4 | Maze::Maze() |
ahmedhedait | 17:68d4b4095d80 | 5 | { |
ahmedhedait | 17:68d4b4095d80 | 6 | |
ahmedhedait | 17:68d4b4095d80 | 7 | } |
ahmedhedait | 17:68d4b4095d80 | 8 | |
ahmedhedait | 17:68d4b4095d80 | 9 | Maze::~Maze() |
ahmedhedait | 17:68d4b4095d80 | 10 | { |
ahmedhedait | 17:68d4b4095d80 | 11 | |
ahmedhedait | 19:c6ebd1394bda | 12 | } |
ahmedhedait | 19:c6ebd1394bda | 13 | |
ahmedhedait | 19:c6ebd1394bda | 14 | void Maze::draw(N5110 &lcd) |
ahmedhedait | 19:c6ebd1394bda | 15 | { |
ahmedhedait | 25:28c57be06933 | 16 | // BORDERS OF THE MAZE STARTING AT (0,0), FILLING THE WHOLE SCREEN AND IS TRANSPARENT. |
ahmedhedait | 19:c6ebd1394bda | 17 | lcd.drawRect(0,0,84,48,FILL_TRANSPARENT); |
ahmedhedait | 19:c6ebd1394bda | 18 | |
ahmedhedait | 25:28c57be06933 | 19 | // INTERIOR WALLS OF THE MAZE ARE DRAWN AS RECTANGLE SEPARATELY. |
ahmedhedait | 25:28c57be06933 | 20 | // _a_b_c _d |
ahmedhedait | 19:c6ebd1394bda | 21 | lcd.drawRect(10,0,1,39,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 22 | lcd.drawRect(18,32,1,15,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 23 | lcd.drawRect(18,25,18,1,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 24 | lcd.drawRect(36,25,1,25,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 25 | lcd.drawRect(45,18,1,30,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 26 | lcd.drawRect(18,18,27,1,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 27 | lcd.drawRect(18,10,27,1,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 28 | lcd.drawRect(45,0,1,11,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 29 | lcd.drawRect(55,6,1,45,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 30 | lcd.drawRect(64,0,1,20,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 31 | lcd.drawRect(64,27,1,13,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 32 | lcd.drawRect(72,10,1,30,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 33 | lcd.drawRect(64,40,20,1,FILL_BLACK); |
ahmedhedait | 19:c6ebd1394bda | 34 | |
ahmedhedait | 19:c6ebd1394bda | 35 | |
ahmedhedait | 25:28c57be06933 | 36 | /* SOME PIXALS ARE REMOVED FROM THE RIGHT SIDE OF THE MAZE TO CREATE THE OPENING FOR |
ahmedhedait | 25:28c57be06933 | 37 | THE BALL TO PASS THROUGH. */ |
ahmedhedait | 19:c6ebd1394bda | 38 | lcd.setPixel(83,24,false); |
ahmedhedait | 19:c6ebd1394bda | 39 | lcd.setPixel(83,25,false); |
ahmedhedait | 19:c6ebd1394bda | 40 | lcd.setPixel(83,26,false); |
ahmedhedait | 19:c6ebd1394bda | 41 | lcd.setPixel(83,27,false); |
ahmedhedait | 19:c6ebd1394bda | 42 | lcd.setPixel(83,28,false); |
ahmedhedait | 19:c6ebd1394bda | 43 | lcd.setPixel(83,29,false); |
ahmedhedait | 19:c6ebd1394bda | 44 | lcd.setPixel(83,30,false); |
ahmedhedait | 17:68d4b4095d80 | 45 | } |