Ahmed Hedait / Mbed 2 deprecated el16ah

Dependencies:   mbed

Committer:
ahmedhedait
Date:
Tue May 08 11:32:13 2018 +0000
Revision:
19:c6ebd1394bda
Parent:
17:68d4b4095d80
Child:
25:28c57be06933
I have implemented the drawing of the maze into its own class.

Who changed what in which revision?

UserRevisionLine numberNew 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 19:c6ebd1394bda 16 //I HAVE DRAWN THE RECTNAGLE OF THE MAZE IN TO START
ahmedhedait 19:c6ebd1394bda 17 lcd.drawRect(0,0,84,48,FILL_TRANSPARENT);
ahmedhedait 19:c6ebd1394bda 18
ahmedhedait 19:c6ebd1394bda 19 // I HAVE DRAWN THE WALLS OF THE MAZE AS RECTANGLES AND JOINED THEM UP IN WHICH TO CREATE THE WALLS OF THE MAZE.
ahmedhedait 19:c6ebd1394bda 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 19:c6ebd1394bda 36 // I REMOVED SOME PIXELS FROM THE RIGHT SIDE OF THE MAZE TO CREATE THE OPENING IN WHICH THE BALL SHOULD GO THROUGH.
ahmedhedait 19:c6ebd1394bda 37 lcd.setPixel(83,24,false);
ahmedhedait 19:c6ebd1394bda 38 lcd.setPixel(83,25,false);
ahmedhedait 19:c6ebd1394bda 39 lcd.setPixel(83,26,false);
ahmedhedait 19:c6ebd1394bda 40 lcd.setPixel(83,27,false);
ahmedhedait 19:c6ebd1394bda 41 lcd.setPixel(83,28,false);
ahmedhedait 19:c6ebd1394bda 42 lcd.setPixel(83,29,false);
ahmedhedait 19:c6ebd1394bda 43 lcd.setPixel(83,30,false);
ahmedhedait 17:68d4b4095d80 44 }