Uses accompanying Basket, Objects and Fruit libraries to create Fruit Basket game. If an object is caught, points are added; if an object in missed, a 'life' is lost.
Dependents: Game_Controller_Project
Catch_Model.h@1:43fbcc3584d6, 2017-03-17 (annotated)
- Committer:
- Nathanj94
- Date:
- Fri Mar 17 15:35:48 2017 +0000
- Revision:
- 1:43fbcc3584d6
- Parent:
- 0:8d02400f792a
- Child:
- 2:8410e09b77aa
One objects now "falls" from the top of the screen to the bottom; Next step is for either multiple objects to fall or for the objects to interact with the basket
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Nathanj94 | 0:8d02400f792a | 1 | #ifndef CATCH_MODEL_H |
Nathanj94 | 0:8d02400f792a | 2 | #define CATCH_MODEL_H |
Nathanj94 | 0:8d02400f792a | 3 | |
Nathanj94 | 0:8d02400f792a | 4 | #include "mbed.h" |
Nathanj94 | 0:8d02400f792a | 5 | #include "N5110.h" |
Nathanj94 | 0:8d02400f792a | 6 | #include "Gamepad.h" |
Nathanj94 | 0:8d02400f792a | 7 | #include "Basket.h" |
Nathanj94 | 1:43fbcc3584d6 | 8 | #include "Objects.h" |
Nathanj94 | 0:8d02400f792a | 9 | |
Nathanj94 | 0:8d02400f792a | 10 | class Catch_Model |
Nathanj94 | 0:8d02400f792a | 11 | { |
Nathanj94 | 0:8d02400f792a | 12 | public: |
Nathanj94 | 0:8d02400f792a | 13 | |
Nathanj94 | 0:8d02400f792a | 14 | Catch_Model(); |
Nathanj94 | 0:8d02400f792a | 15 | ~Catch_Model(); |
Nathanj94 | 0:8d02400f792a | 16 | |
Nathanj94 | 1:43fbcc3584d6 | 17 | void init(int basket_y, int basket_width, int objects_speed); |
Nathanj94 | 0:8d02400f792a | 18 | void input(Gamepad &pad); |
Nathanj94 | 0:8d02400f792a | 19 | void update(Gamepad &pad); |
Nathanj94 | 0:8d02400f792a | 20 | void draw(N5110 &lcd); |
Nathanj94 | 0:8d02400f792a | 21 | |
Nathanj94 | 0:8d02400f792a | 22 | private: |
Nathanj94 | 0:8d02400f792a | 23 | |
Nathanj94 | 0:8d02400f792a | 24 | Basket _basket; |
Nathanj94 | 1:43fbcc3584d6 | 25 | Objects _objects; |
Nathanj94 | 0:8d02400f792a | 26 | |
Nathanj94 | 0:8d02400f792a | 27 | int _basket_y; |
Nathanj94 | 0:8d02400f792a | 28 | int _basket_width; |
Nathanj94 | 1:43fbcc3584d6 | 29 | int _objects_speed; |
Nathanj94 | 0:8d02400f792a | 30 | |
Nathanj94 | 0:8d02400f792a | 31 | Direction _d; |
Nathanj94 | 0:8d02400f792a | 32 | float _mag; |
Nathanj94 | 0:8d02400f792a | 33 | |
Nathanj94 | 0:8d02400f792a | 34 | }; |
Nathanj94 | 0:8d02400f792a | 35 | #endif |