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.
Paddle.h
00001 #ifndef PADDLE_H 00002 #define PADDLE_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 #include "GameObject.h" 00008 00009 /** number of pixels on display */ 00010 #define WIDTH 84 /**< width of screen */ 00011 #define HEIGHT 48 /**< height of screen */ 00012 // gap from edge of screen 00013 #define GAP 4 /**< distance of pad from bottom of screen */ 00014 00015 /** Paddle Class 00016 , Controls for the paddle in the Breakout game, inherits from GameObject, because the paddle is a game object 00017 @author Kostadin Chakarov, University of Leeds 00018 @date March 2019 00019 */ 00020 00021 class Paddle : public GameObject 00022 { 00023 00024 public: 00025 /** Constructor */ 00026 Paddle(); 00027 /** Destructor */ 00028 ~Paddle(); 00029 /** Determines control method for paddle */ 00030 void controlPaddle(Gamepad &pad); 00031 /** Controls movement of paddle */ 00032 virtual void move(); 00033 /** Resets paddle to initial starting point */ 00034 void reset(); 00035 /** Gets the speed of the paddle 00036 * @return the speed of the paddle 00037 */ 00038 float getSpeed() {return _speed;} 00039 /** Sets the speed of the paddle 00040 * @param value - sets the speed equal to it 00041 */ 00042 void setSpeed(float value) { _speed = value;} 00043 00044 private: 00045 Direction _d; /** Allows controlling with the joystick */ 00046 float _speed; /** Speed of the paddle */ 00047 }; 00048 00049 #endif
Generated on Thu Jul 14 2022 02:02:53 by
1.7.2