I finally got a solution to this problem. I added the variables xNew and yNew that take the values of x and y and add them on to the existing values. This allowed me to move the square around the screen. xNew and yNew are initialize at the top of the class below is the code for the input from controller and the result in rectangle.
`
void Graphics::rectangle(int x, int y)
{
xNew += x;
yNew += -y;
{
r1.x1 = xNew;
r1.y1 = yNew;
r1.x2 = r1.x1 + 50;
r1.y2 = r1.y1 + 50;
}
}
void Game::update()
{
LONG x = input->getGamepadThumbRX(0);
LONG y = input->getGamepadThumbRY(0);
float x1 = x/32767;
float y1 = y/32767;
float factor = 10;
int dx = int(factor * x1);
int dy = int(factor * y1);
graphics->rectangle(dx,dy);
}`