public void move(){
if (x<0 || x > 1450 || y < 0 || y >1000) {
            this.switchDirection();         
}
if(direction=='u'){y-=5;}
else if(direction=='d'){y+=5;}
else if(direction=='l'){x-=5;}
else if(direction=='r'){x+=5;}
}