Kostadin Chakarov / Mbed 2 deprecated el17kec

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Ball.h Source File

Ball.h

00001 #ifndef BALL_H
00002 #define BALL_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "GameObject.h"
00007 #include "Gamepad.h"
00008 #include "Paddle.h"
00009 
00010 /** Ball Class
00011 , Controls the ball in the Breakout game, inherits from GameObject, because the ball is a game object
00012 @author Kostadin Chakarov, University of Leeds
00013 @date March 2019
00014 */
00015 
00016 class Ball : public GameObject
00017 {
00018 
00019 public:
00020     /** Constructor */
00021     Ball();
00022     /** Destructor */
00023     ~Ball();
00024     /** Controls movement physics of paddle */
00025     virtual void move();
00026     /** Checks for collision between ball and paddle and resolves it */
00027     void hitPad(Paddle &paddle);
00028     /** Randomizes the initial x-direction of the ball 
00029     * @return either 1 or -1 for the initial x-velocity of the ball
00030     */
00031     int randomize();
00032     /** Resets ball to initial starting point */
00033     void reset();
00034 
00035 private:
00036 };
00037 #endif