![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Stick_Runner
Dependencies: FXOS8700CQ Gamepad N5110 SDFileSystem mbed
Character/Character.h@1:db9ff66f67c8, 2017-04-28 (annotated)
- Committer:
- el15ss
- Date:
- Fri Apr 28 16:30:47 2017 +0000
- Revision:
- 1:db9ff66f67c8
- Parent:
- 0:12cfe63faa6a
- Child:
- 2:98a41609c827
Need to add accelerometer functonality
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15ss | 0:12cfe63faa6a | 1 | #ifndef Character_H |
el15ss | 0:12cfe63faa6a | 2 | #define Character_H |
el15ss | 0:12cfe63faa6a | 3 | |
el15ss | 0:12cfe63faa6a | 4 | #include "mbed.h" |
el15ss | 0:12cfe63faa6a | 5 | #include "N5110.h" |
el15ss | 0:12cfe63faa6a | 6 | #include "Gamepad.h" |
el15ss | 0:12cfe63faa6a | 7 | |
el15ss | 0:12cfe63faa6a | 8 | class Character |
el15ss | 0:12cfe63faa6a | 9 | { |
el15ss | 0:12cfe63faa6a | 10 | public: |
el15ss | 0:12cfe63faa6a | 11 | |
el15ss | 0:12cfe63faa6a | 12 | Character(); |
el15ss | 0:12cfe63faa6a | 13 | ~Character(); |
el15ss | 0:12cfe63faa6a | 14 | void init(); |
el15ss | 0:12cfe63faa6a | 15 | void draw(N5110 &lcd); |
el15ss | 1:db9ff66f67c8 | 16 | void updateCharacter(Direction d,float mag); |
el15ss | 1:db9ff66f67c8 | 17 | void characterStatus(Vector2D p); |
el15ss | 1:db9ff66f67c8 | 18 | void characterScore(Vector2D p); |
el15ss | 0:12cfe63faa6a | 19 | void add_score(); |
el15ss | 0:12cfe63faa6a | 20 | int get_score(); |
el15ss | 1:db9ff66f67c8 | 21 | Vector2D getCharacterPos(); |
el15ss | 1:db9ff66f67c8 | 22 | bool getCharacterStatus(); |
el15ss | 0:12cfe63faa6a | 23 | |
el15ss | 0:12cfe63faa6a | 24 | private: |
el15ss | 0:12cfe63faa6a | 25 | |
el15ss | 0:12cfe63faa6a | 26 | int _height; |
el15ss | 0:12cfe63faa6a | 27 | int _width; |
el15ss | 1:db9ff66f67c8 | 28 | int charPosX; |
el15ss | 1:db9ff66f67c8 | 29 | int charPosY; |
el15ss | 0:12cfe63faa6a | 30 | int _speed; |
el15ss | 0:12cfe63faa6a | 31 | int _score; |
el15ss | 1:db9ff66f67c8 | 32 | bool charStatus; |
el15ss | 1:db9ff66f67c8 | 33 | // int counter; |
el15ss | 0:12cfe63faa6a | 34 | |
el15ss | 0:12cfe63faa6a | 35 | }; |
el15ss | 0:12cfe63faa6a | 36 | #endif |