class for obstacles in Car_race game
Obstacles.h@8:c8007ccac5c0, 2017-04-19 (annotated)
- Committer:
- fy14aaz
- Date:
- Wed Apr 19 20:55:18 2017 +0000
- Revision:
- 8:c8007ccac5c0
- Parent:
- 1:a735e7396af4
- Child:
- 9:d5f90988545e
added the score feature that controls the ability to shooting the obstacles; need;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fy14aaz | 0:f8968ec0ec1b | 1 | #ifndef OBSTACLES_H |
fy14aaz | 0:f8968ec0ec1b | 2 | #define OBSTACLES_H |
fy14aaz | 0:f8968ec0ec1b | 3 | |
fy14aaz | 0:f8968ec0ec1b | 4 | #include "mbed.h" |
fy14aaz | 0:f8968ec0ec1b | 5 | #include "N5110.h" |
fy14aaz | 0:f8968ec0ec1b | 6 | #include "Gamepad.h" |
fy14aaz | 0:f8968ec0ec1b | 7 | |
fy14aaz | 0:f8968ec0ec1b | 8 | class Obstacles |
fy14aaz | 0:f8968ec0ec1b | 9 | |
fy14aaz | 0:f8968ec0ec1b | 10 | { |
fy14aaz | 0:f8968ec0ec1b | 11 | |
fy14aaz | 0:f8968ec0ec1b | 12 | public: |
fy14aaz | 0:f8968ec0ec1b | 13 | |
fy14aaz | 0:f8968ec0ec1b | 14 | Obstacles(); |
fy14aaz | 0:f8968ec0ec1b | 15 | ~Obstacles(); |
fy14aaz | 0:f8968ec0ec1b | 16 | |
fy14aaz | 0:f8968ec0ec1b | 17 | void init(int seed); |
fy14aaz | 1:a735e7396af4 | 18 | void draw(N5110 &lcd,int seed); |
fy14aaz | 1:a735e7396af4 | 19 | void update(N5110 &lcd); |
fy14aaz | 8:c8007ccac5c0 | 20 | void addScore(N5110 &lcd); |
fy14aaz | 8:c8007ccac5c0 | 21 | void resetScore(); |
fy14aaz | 8:c8007ccac5c0 | 22 | int getScore(); |
fy14aaz | 8:c8007ccac5c0 | 23 | |
fy14aaz | 0:f8968ec0ec1b | 24 | |
fy14aaz | 0:f8968ec0ec1b | 25 | private: |
fy14aaz | 0:f8968ec0ec1b | 26 | |
fy14aaz | 1:a735e7396af4 | 27 | |
fy14aaz | 0:f8968ec0ec1b | 28 | int _Obstacle_x; |
fy14aaz | 8:c8007ccac5c0 | 29 | int _score; |
fy14aaz | 0:f8968ec0ec1b | 30 | }; |
fy14aaz | 0:f8968ec0ec1b | 31 | |
fy14aaz | 0:f8968ec0ec1b | 32 | #endif |