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
Diff: Ball2/Ball2.h
- Revision:
- 12:2af7b4868033
diff -r 1447cb7dce3c -r 2af7b4868033 Ball2/Ball2.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Ball2/Ball2.h Wed May 27 07:00:37 2020 +0000
@@ -0,0 +1,34 @@
+#ifndef BALL2_H
+#define BALL2_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+#include "Paddle.h"
+
+/** Ball Class
+@author Dr Craig A. Evans, University of Leeds
+@brief Controls the ball in the Pong game
+@date Febraury 2017
+*/
+class Ball2
+{
+ public:
+ Ball2();
+ ~Ball2();
+ void init(int size,int speed);
+ void draw(N5110 &lcd);
+ void update();
+ /// accessors and mutators
+ void set_velocity(Vector2D v);
+ Vector2D get_velocity();
+ Vector2D get_pos();
+ void set_pos(Vector2D p);
+
+ private:
+ Vector2D _velocity;
+ int _size;
+ int _x;
+ int _y;
+};
+#endif
\ No newline at end of file