![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Brickbreaker
Dependencies: NokiaLCD PS2 mbed
Fork of Pong by
block.h@3:e1328f84b107, 2013-04-29 (annotated)
- Committer:
- ipapp3
- Date:
- Mon Apr 29 18:14:57 2013 +0000
- Revision:
- 3:e1328f84b107
Final commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ipapp3 | 3:e1328f84b107 | 1 | #include "NokiaLCD.h" |
ipapp3 | 3:e1328f84b107 | 2 | |
ipapp3 | 3:e1328f84b107 | 3 | class Block |
ipapp3 | 3:e1328f84b107 | 4 | { |
ipapp3 | 3:e1328f84b107 | 5 | /* This class creates a block object */ |
ipapp3 | 3:e1328f84b107 | 6 | |
ipapp3 | 3:e1328f84b107 | 7 | // Attributes |
ipapp3 | 3:e1328f84b107 | 8 | int x,y,width,height,color; |
ipapp3 | 3:e1328f84b107 | 9 | |
ipapp3 | 3:e1328f84b107 | 10 | public: |
ipapp3 | 3:e1328f84b107 | 11 | // Constructors |
ipapp3 | 3:e1328f84b107 | 12 | Block(); |
ipapp3 | 3:e1328f84b107 | 13 | Block(int x, int y, int w, int h, int c); |
ipapp3 | 3:e1328f84b107 | 14 | |
ipapp3 | 3:e1328f84b107 | 15 | // Member functions |
ipapp3 | 3:e1328f84b107 | 16 | void move(NokiaLCD &lcd, int increment); |
ipapp3 | 3:e1328f84b107 | 17 | void moveCPU(NokiaLCD &lcd, int _y); |
ipapp3 | 3:e1328f84b107 | 18 | void draw(NokiaLCD &lcd, bool isBlack) const; |
ipapp3 | 3:e1328f84b107 | 19 | int size() const; |
ipapp3 | 3:e1328f84b107 | 20 | int getWidth() const; |
ipapp3 | 3:e1328f84b107 | 21 | int getHeight() const; |
ipapp3 | 3:e1328f84b107 | 22 | int getX() const; |
ipapp3 | 3:e1328f84b107 | 23 | int getY() const; |
ipapp3 | 3:e1328f84b107 | 24 | |
ipapp3 | 3:e1328f84b107 | 25 | }; |