The Gates

by: Jim McCann (jmccann)

At certain times, and from certain angles, you can see through the cracks in reality, and -- if you concentrate -- slip into other worlds.

You rotate your viewpoint and change the current time in order to animate a collection of asteroids until they line up to show a picture of a gate to a new world (which, in turn, contains a collection of asteroids to rotate).

Gameplay

The game begins with a random view angle and time point.

The player uses the mouse (click and drag) to rotate the view around the vertical axis (left/right movement) and to change time between 0.0 and 1.0 (up/down movement). Time changes cause blobs to spin around their own axes, while view changes change the camera position.

If the user presses SPACE when the view is close to the correct view, the view animates to exactly the correct view, the target image is faded in, and then fades out to the next level.

Levels are generated by randomly placing blob shapes in the world, setting a random spin velocity for each shape, and setting a random target viewpoint. A depth map is rendered from the target viewpoint in order to determine which asteroids are closest to each pixel (basically, this is a shadow map). The fragment shader for each asteroid looks up whether it faces the target viewpoint and is closest by using this depth map, and then either picks a pixel from the target texture or from a generic asteroid texture cube-map.

For extra self-reference, the target image may be computed by rendering the next puzzle in the game.

Assets

NASA has a good collection of space images.

From the NASA Photo Gallery FAQ: Unless otherwise noted, the images presented on NSSDCA's Photo Gallery are in the public domain. As such, they may be used for any purpose. NSSDCA does ask, however, that you acknowledge NASA and the NSSDCA as the supplier of the data. In addition, where the source of the image (by project or as a specific person) is credited in the text, you should also acknowledge that, too.