333333333
Embed:
(wiki syntax)
Show/hide line numbers
Ball.h
00001 #ifndef BALL_H 00002 #define BALL_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 #include "Paddle.h" 00008 00009 /** Ball Class 00010 @author Dr Craig A. Evans, University of Leeds 00011 @brief Controls the ball in the Pong game 00012 @date Febraury 2017 00013 */ 00014 class Ball 00015 { 00016 00017 public: 00018 Ball(); 00019 ~Ball(); 00020 void init(int size,int speed); 00021 void draw(N5110 &lcd); 00022 void update(); 00023 /// accessors and mutators 00024 void set_velocity(Vector2D v); 00025 Vector2D get_velocity(); 00026 Vector2D get_pos(); 00027 void set_pos(Vector2D p); 00028 00029 private: 00030 00031 Vector2D _velocity; 00032 int _size; 00033 int _x; 00034 int _y; 00035 }; 00036 #endif
Generated on Wed Jul 13 2022 09:07:26 by
1.7.2