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

Committer:
Nathanj94
Date:
Sat Mar 18 14:06:17 2017 +0000
Revision:
2:8410e09b77aa
Parent:
1:43fbcc3584d6
Child:
3:fc9133faec7a
functions added to check if the object is caught in the basket or not, unfinished

Who changed what in which revision?

UserRevisionLine numberNew 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 2:8410e09b77aa 21 void check_basket_catch(N5110 &lcd);
Nathanj94 2:8410e09b77aa 22 void check_basket_miss();
Nathanj94 2:8410e09b77aa 23
Nathanj94 0:8d02400f792a 24
Nathanj94 0:8d02400f792a 25 private:
Nathanj94 0:8d02400f792a 26
Nathanj94 0:8d02400f792a 27 Basket _basket;
Nathanj94 1:43fbcc3584d6 28 Objects _objects;
Nathanj94 0:8d02400f792a 29
Nathanj94 0:8d02400f792a 30 int _basket_y;
Nathanj94 0:8d02400f792a 31 int _basket_width;
Nathanj94 1:43fbcc3584d6 32 int _objects_speed;
Nathanj94 0:8d02400f792a 33
Nathanj94 2:8410e09b77aa 34 int basket_pos;
Nathanj94 2:8410e09b77aa 35 int objects_pos;
Nathanj94 2:8410e09b77aa 36
Nathanj94 0:8d02400f792a 37 Direction _d;
Nathanj94 0:8d02400f792a 38 float _mag;
Nathanj94 0:8d02400f792a 39
Nathanj94 0:8d02400f792a 40 };
Nathanj94 0:8d02400f792a 41 #endif