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
- Committer:
- Nathanj94
- Date:
- 2017-04-20
- Revision:
- 12:f7d6003e5c6b
- Parent:
- 10:6605cd9d374b
- Child:
- 13:ae2dac4ab786
File content as of revision 12:f7d6003e5c6b:
#ifndef CATCH_MODEL_H #define CATCH_MODEL_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Basket.h" #include "Objects.h" #include "ABXY.h" class Catch_Model { public: Catch_Model(); ~Catch_Model(); void init(int basket_y, int basket_width, int objects_speed, int lives); void input(Gamepad &pad); void update(N5110 &lcd, Gamepad &pad); void draw(N5110 &lcd); void check_basket_catch(N5110 &lcd, Gamepad &pad); void check_basket_miss(N5110 &lcd, Gamepad &pad); void check_a(N5110 &lcd, Gamepad &pad); void check_b(N5110 &lcd, Gamepad &pad); void check_x(N5110 &lcd, Gamepad &pad); void set_delay(); void add_score(); int get_lives(); void print_lives(N5110 &lcd); void print_score(N5110 &lcd); void print_delay(N5110 &lcd); private: Basket basket; Objects objects; Timeout timeout; int _basket_y; int _basket_width; int _objects_speed; int _lives; int _delay; Direction _d; float _mag; }; #endif