ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

Cricket/Cricket.h

Committer:
shahidsajid
Date:
2019-04-22
Revision:
11:f481ec642cc5
Parent:
10:6c6e09023942
Child:
12:954da4f4e565

File content as of revision 11:f481ec642cc5:

#ifndef CRICKET_H
#define CRICKET_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Ball.h"

/** Ball Class
@author Dr Craig A. Evans, University of Leeds
@brief Controls the ball in the Pong game 
@date Febraury 2017
*/ 
class Cricket
{

public:
    Cricket();
    ~Cricket();
    void init();
    void draw(N5110 &lcd);
    void set_field(N5110 &lcd);
    void draw_field(N5110 &lcd);
    void update_game(int checkHit, Direction dir);
    void play_game(N5110 &lcd,Gamepad &pad);
    void game(N5110 &lcd,Gamepad &pad);
    
    
private:
    Ball ball;
    Bat bat;
    struct Fielder{
        Direction dir;
        int x;
        int y;
        int position;
    };
    Fielder field[5];
    int direction_set;
    Vector2D ball_position;
    int new_round;
    int fieldNumbers[10];
    int ballHit;
    int d;
    int _size;
    int _x;
    int _y;
};
#endif