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.
Dependencies: mbed
Cricket/Cricket.h
- Committer:
- shahidsajid
- Date:
- 2019-04-27
- Revision:
- 18:a260ce8db9e7
- Parent:
- 15:81a3aaf52647
- Child:
- 19:e1ded5acb64a
File content as of revision 18:a260ce8db9e7:
#ifndef CRICKET_H #define CRICKET_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Ball.h" #include "Scoreboard.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 set_init_positions(int x,int y, Direction direction,int no); void set_ball_direction(Direction dir); void draw_field(N5110 &lcd); void update_game(int checkHit,int loft_check, Direction dir,Gamepad &pad); void play_game(N5110 &lcd,Gamepad &pad); void update_scoreboard(int checkUpdate, int runs,Gamepad &pad); void batsman_out(string messsage,Gamepad &pad); void check_victory(N5110 &lcd); void game(N5110 &lcd,Gamepad &pad); void init_positions(); void reset(); int check_fielder(Direction dir); void check_ball_count(N5110 &lcd); private: Ball ball; Bat bat; Scoreboard scoreboard; struct fielder_positions{ Direction dir; int x; int y; int no; }; fielder_positions positions[7]; struct Fielder{ Direction dir; int x; int y; int position; }; Fielder field[5]; int direction_set; Vector2D ball_position; Direction ball_direction; int check_bowled; int init_field_counter; int outfield_fielder; int fieldersCount; int new_round; int fieldNumbers[10]; int fielder_no; int ballHit; int check_hit; int _ball_limit; int new_game; int check_update; int loft_check; int d; int _size; int _x; int _y; }; #endif