I am making a small game, 2D, and I have a player. 

EDIT:

This is what I have right now: 

```
        int oldX = player.x;
    int oldY = player.y;

    int newX = oldX - player.getSpeedX();
    int newY = oldY - player.getSpeedY();

    if(player.getBounds().intersects(brush1.getBounds())){
        player.x = newX;
        player.y = newY;
    }else{
        player.x = oldX;
        player.y = oldY;
    }

```

But, it is acting really weird, it changes speed when I go in from one side, etc.