public void playermove(){
            if (upPressed)
            {
                if(!player.offscreentop) 
                {
                    player.setY(player.getY() - playerSpeed);
                }             
            } 
            if (downPressed)
                    {
                        if(!player.offscreenbottom) 
                        {
                            player.setY(player.getY() + playerSpeed);
                        }
                    }
            if (leftPressed){
                if(!player.offscreenleft)
                {
                    player.setX(player.getX() - playerSpeed);
                }
            }
            if (rightPressed)
                if(!player.offscreenright)
                {
                    player.setX(player.getX() + playerSpeed);
                }
        }