I watched this when I was younger but I already forgot its name. Google didn't help much. If I remember correctly it's set in an earth turned into a global desert & the main character is a male living in a walled city(?). One episode I can remember is set in a carnival in the middle of the desert where the characters tried the virtual reality game. Also the anime series ends with the earth consumed in a huge flood when the machine that holds Antarctica breaks down and it melts, but the main character survives on a floating ship and his whole person transferred into a virtual world.