The Hidden Math in Video Games: Toroidal Geometry and Beyond