public void player1move(){
            if (leftPressed)
            {
                if(!player1.offscreenleft) 
                {
                    player1.setX(player1.getX() - player1Speed);
                }             
            } else if (rightPressed)
                    {
                        if(!player1.offscreenright) 
                        {
                            player1.setX(player1.getX() + player1Speed);
                        }
                    }
            if (upPressed)
            {
                if(!player1.offscreentop) 
                {
                    player1.setY(player1.getY() - player1Speed);
                }             
            }
            if (downPressed)
            {
                if(!player1.offscreenbottom) 
                    {
                        player1.setY(player1.getY() + player1Speed);
                    }
            }
        }