« Back to documentation index
ball Class Reference
This library has been made to allow the ball to update, check its position.
More...
#include <Ball.h >
Public Member Functions
ball (int x1, int y1, int x1_Pos_state, int y1_Pos_state)
Ball will give me the integers for x1,y1,x1 position, y1 position .
void setX (int value)
Switches a pixel on in a particular coordinate in the X axis.
void setY (int value)
Switches a pixel on in a particular coordinate in the Y axis.
int lookforX ()
Switches a pixel on in a particular coordinate in the X axis.
int lookforY ()
int lookforPos_stateX ()
int lookforPos_stateY ()
Checks the position state on the Y coordinate.
void BallcollisionState (int xPos_state, int yPos_state)
Checks the Collisions state on the X and Y coordinates.
void dbal (N5110 &display)
Diameter of the ball.
void clear_dbal (N5110 &display)
States the clearing of pixels for the ball as it moves.
void Refresh_pos ()
This is used to refresh the position of the ball.
Detailed Description
This library has been made to allow the ball to update, check its position.
etc This will make the coding later on in the main file a bit easier to manipulate. Revision 1.0
Author: Jefferson Sanchez
Date: April 2016
Definition at line 20 of file Ball.h .
Constructor & Destructor Documentation
ball
(
int
x1 ,
int
y1 ,
int
x1_Pos_state ,
int
y1_Pos_state
)
Ball will give me the integers for x1,y1,x1 position, y1 position .
Parameters:
pin connected to PTB3 in a Digital Input
Pin Connected to PTB2 in a Digital Input
Pins connected to +5v and GND to be able to obtain an integer value.
Definition at line 32 of file Ball.h .
Member Function Documentation
void BallcollisionState
(
int
xPos_state ,
int
yPos_state
)
Checks the Collisions state on the X and Y coordinates.
Definition at line 47 of file Ball.cpp .
void clear_dbal
(
N5110 &
display )
States the clearing of pixels for the ball as it moves.
Definition at line 63 of file Ball.cpp .
void dbal
(
N5110 &
display )
Diameter of the ball.
Definition at line 53 of file Ball.cpp .
int lookforPos_stateX
(
)
Parameters:
Checks the position state on the X coordinate.
Returns: x position state.
Definition at line 37 of file Ball.cpp .
int lookforPos_stateY
(
)
Checks the position state on the Y coordinate.
Returns: y position state.
Definition at line 42 of file Ball.cpp .
Switches a pixel on in a particular coordinate in the X axis.
ball.setY(23);
Definition at line 25 of file Ball.cpp .
Parameters:
Allows me to check to see what pixels are on in the Y coordinate.
Returns: y value.
Definition at line 31 of file Ball.cpp .
This is used to refresh the position of the ball.
Definition at line 73 of file Ball.cpp .
Switches a pixel on in a particular coordinate in the X axis.
ball.setX(41);
Definition at line 15 of file Ball.cpp .
Switches a pixel on in a particular coordinate in the Y axis.
ball.setY(23);
Definition at line 20 of file Ball.cpp .