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.
Gold/Gold.h@1:9c7bb3db32bc, 2020-04-22 (annotated)
- Committer:
- ZhongYufan
- Date:
- Wed Apr 22 15:52:04 2020 +0000
- Revision:
- 1:9c7bb3db32bc
- Child:
- 8:c5969685cf02
claw, gold, winch, monster finished (commit test)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ZhongYufan | 1:9c7bb3db32bc | 1 | #ifndef GOLD_H |
ZhongYufan | 1:9c7bb3db32bc | 2 | #define GOLD_H |
ZhongYufan | 1:9c7bb3db32bc | 3 | |
ZhongYufan | 1:9c7bb3db32bc | 4 | #include "mbed.h" |
ZhongYufan | 1:9c7bb3db32bc | 5 | #include "N5110.h" |
ZhongYufan | 1:9c7bb3db32bc | 6 | #include "Gamepad.h" |
ZhongYufan | 1:9c7bb3db32bc | 7 | #include "Winch.h" |
ZhongYufan | 1:9c7bb3db32bc | 8 | #include "Monster.h" |
ZhongYufan | 1:9c7bb3db32bc | 9 | |
ZhongYufan | 1:9c7bb3db32bc | 10 | /** Gold Class |
ZhongYufan | 1:9c7bb3db32bc | 11 | @author Dr Craig A. Evans, University of Leeds |
ZhongYufan | 1:9c7bb3db32bc | 12 | @brief Controls the claw in the Pong game |
ZhongYufan | 1:9c7bb3db32bc | 13 | @date Febraury 2017 |
ZhongYufan | 1:9c7bb3db32bc | 14 | */ |
ZhongYufan | 1:9c7bb3db32bc | 15 | class Gold |
ZhongYufan | 1:9c7bb3db32bc | 16 | { |
ZhongYufan | 1:9c7bb3db32bc | 17 | |
ZhongYufan | 1:9c7bb3db32bc | 18 | public: |
ZhongYufan | 1:9c7bb3db32bc | 19 | Gold(); |
ZhongYufan | 1:9c7bb3db32bc | 20 | ~Gold(); |
ZhongYufan | 1:9c7bb3db32bc | 21 | void init(int gold_num); |
ZhongYufan | 1:9c7bb3db32bc | 22 | void draw(N5110 &lcd); |
ZhongYufan | 1:9c7bb3db32bc | 23 | void update(); |
ZhongYufan | 1:9c7bb3db32bc | 24 | void gold_caught(int caught_i); |
ZhongYufan | 1:9c7bb3db32bc | 25 | void gold_reached(int reached_i); |
ZhongYufan | 1:9c7bb3db32bc | 26 | int get_reached_num(); |
ZhongYufan | 1:9c7bb3db32bc | 27 | /// accessors and mutators |
ZhongYufan | 1:9c7bb3db32bc | 28 | Vector2D get_pos(int gold_i); |
ZhongYufan | 1:9c7bb3db32bc | 29 | void set_pos(Vector2D p); |
ZhongYufan | 1:9c7bb3db32bc | 30 | |
ZhongYufan | 1:9c7bb3db32bc | 31 | private: |
ZhongYufan | 1:9c7bb3db32bc | 32 | int _gold_num; |
ZhongYufan | 1:9c7bb3db32bc | 33 | int _gold_left; |
ZhongYufan | 1:9c7bb3db32bc | 34 | int _gold_caught[12]; |
ZhongYufan | 1:9c7bb3db32bc | 35 | int _gold_reached[12]; |
ZhongYufan | 1:9c7bb3db32bc | 36 | int _x[12]; |
ZhongYufan | 1:9c7bb3db32bc | 37 | int _y[12]; |
ZhongYufan | 1:9c7bb3db32bc | 38 | |
ZhongYufan | 1:9c7bb3db32bc | 39 | }; |
ZhongYufan | 1:9c7bb3db32bc | 40 | #endif |