private void gravity(){
        for(int i = 0; i < world.arrayNum; i++){
            if(!world.isSolid[i] && !playerRect.intersects(world.blocks[i])){
                setYDirection(1);
            }else if(world.isSolid[i] && playerRect.intersects(world.blocks[i])){
                setYDirection(0);
                Grounded = true;
            }
        }
    }