public void player2move(){
            if (WPressed)
            {
                if(!player2.offscreentop) 
                {
                    player2.setY(player2.getY() - player2Speed);
                }
            } 
            if (SPressed)
                {
                    if(!player2.offscreenbottom) 
                    {
                        player2.setY(player2.getY() + player2Speed);
                    }
                       
                }
            if (APressed){
                if (!player2.offscreenleft){
                    player2.setX(player2.getX() - player2Speed);
                }
            }
            
            if (DPressed){
                if (!player2.offscreenright){
                    player2.setX(player2.getX() + player2Speed);
                }
                
            }
            
        }