Jefferson Sanchez / Ping_Pong
Revision:
0:ef8d5a4464a3
diff -r 000000000000 -r ef8d5a4464a3 Ball.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Ball.cpp	Wed May 04 23:22:04 2016 +0000
@@ -0,0 +1,78 @@
+
+/**
+**
+@file Ball.cpp
+@brief File containing all the functions prototypes , void etc for the ball.
+@brief Shows examples of creating Doxygen documentation.
+@brief Revision 1.0.
+@author Jefferson Sanchez
+@date  April 2016
+*/
+
+
+#include "Ball.h"
+// @paramFunction to set the x value 
+void ball::setX(int value)
+{
+    x = value;
+}
+// Function to set the y value 
+void ball::setY(int value)
+{
+    y = value;
+}
+// Function to look for or check for the x value to be later used on the code .
+int ball::lookforX()
+{
+    return x;
+}
+// Function to look for or check for the y value to be later used on the code 
+
+int ball::lookforY()
+{
+    return y;
+}
+// Function to look for or check for the x value to ve later used on the code 
+
+int ball::lookforPos_stateX()
+{
+    return x_Pos_state;
+}
+
+int ball::lookforPos_stateY()
+{
+    return y_Pos_state;
+}
+
+void ball::BallcollisionState(int xPos_state, int yPos_state)
+{
+    x_Pos_state = xPos_state;
+    y_Pos_state = yPos_state;
+}
+
+void ball::dbal(N5110 &display)
+{
+  // this states the diameter of the ball
+    for(int i = -3; i < 3; i++)
+        for(int j = -3; j < 3; j++)
+            display.setPixel(x + j, y + i);
+    
+    display.refresh();
+}
+
+void ball::clear_dbal(N5110 &display)
+{
+    //states the clearing of the ball as it moves 
+    for(int i = -3; i < 3; i++)
+        for(int j = -3; j < 3; j++)
+            display.clearPixel(x + j, y + i);
+    
+    display.refresh();
+}
+
+void ball::Refresh_pos()
+{
+    x += x_Pos_state;
+    y += y_Pos_state;
+}
+// end of code 
\ No newline at end of file