ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

Committer:
shahidsajid
Date:
Mon Apr 22 19:57:01 2019 +0000
Revision:
11:f481ec642cc5
Parent:
10:6c6e09023942
Child:
12:954da4f4e565
Fixed play_game bug;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shahidsajid 10:6c6e09023942 1 #ifndef CRICKET_H
shahidsajid 10:6c6e09023942 2 #define CRICKET_H
shahidsajid 10:6c6e09023942 3
shahidsajid 10:6c6e09023942 4 #include "mbed.h"
shahidsajid 10:6c6e09023942 5 #include "N5110.h"
shahidsajid 10:6c6e09023942 6 #include "Gamepad.h"
shahidsajid 10:6c6e09023942 7 #include "Ball.h"
shahidsajid 10:6c6e09023942 8
shahidsajid 10:6c6e09023942 9 /** Ball Class
shahidsajid 10:6c6e09023942 10 @author Dr Craig A. Evans, University of Leeds
shahidsajid 10:6c6e09023942 11 @brief Controls the ball in the Pong game
shahidsajid 10:6c6e09023942 12 @date Febraury 2017
shahidsajid 10:6c6e09023942 13 */
shahidsajid 10:6c6e09023942 14 class Cricket
shahidsajid 10:6c6e09023942 15 {
shahidsajid 10:6c6e09023942 16
shahidsajid 10:6c6e09023942 17 public:
shahidsajid 10:6c6e09023942 18 Cricket();
shahidsajid 10:6c6e09023942 19 ~Cricket();
shahidsajid 10:6c6e09023942 20 void init();
shahidsajid 10:6c6e09023942 21 void draw(N5110 &lcd);
shahidsajid 10:6c6e09023942 22 void set_field(N5110 &lcd);
shahidsajid 10:6c6e09023942 23 void draw_field(N5110 &lcd);
shahidsajid 10:6c6e09023942 24 void update_game(int checkHit, Direction dir);
shahidsajid 11:f481ec642cc5 25 void play_game(N5110 &lcd,Gamepad &pad);
shahidsajid 11:f481ec642cc5 26 void game(N5110 &lcd,Gamepad &pad);
shahidsajid 10:6c6e09023942 27
shahidsajid 10:6c6e09023942 28
shahidsajid 10:6c6e09023942 29 private:
shahidsajid 10:6c6e09023942 30 Ball ball;
shahidsajid 10:6c6e09023942 31 Bat bat;
shahidsajid 10:6c6e09023942 32 struct Fielder{
shahidsajid 10:6c6e09023942 33 Direction dir;
shahidsajid 10:6c6e09023942 34 int x;
shahidsajid 10:6c6e09023942 35 int y;
shahidsajid 10:6c6e09023942 36 int position;
shahidsajid 10:6c6e09023942 37 };
shahidsajid 10:6c6e09023942 38 Fielder field[5];
shahidsajid 10:6c6e09023942 39 int direction_set;
shahidsajid 10:6c6e09023942 40 Vector2D ball_position;
shahidsajid 10:6c6e09023942 41 int new_round;
shahidsajid 10:6c6e09023942 42 int fieldNumbers[10];
shahidsajid 10:6c6e09023942 43 int ballHit;
shahidsajid 10:6c6e09023942 44 int d;
shahidsajid 10:6c6e09023942 45 int _size;
shahidsajid 10:6c6e09023942 46 int _x;
shahidsajid 10:6c6e09023942 47 int _y;
shahidsajid 10:6c6e09023942 48 };
shahidsajid 10:6c6e09023942 49 #endif