2
\$\begingroup\$

In the games such as Defender (1980 arcade) and Defcon, the player can move/scroll in one direction infinitely because the level/terrain simply wraps over and over again(like if it was wrapped around the side of a cylinder).

I am more interested in the wrapping mechanics of Defcon which wrap(on the x-axis) and zoom the entire level. Here is a link to view the game.

To make images(such as a background) wrap is it a per-pixel approach? Is there a function? What methods are there to achieve the circular wrapping of a level?

\$\endgroup\$
  • \$\begingroup\$ Linear wrapping should do the trick. \$\endgroup\$ – Vaughan Hilts Jul 4 '13 at 21:40
  • 1
    \$\begingroup\$ Defcon's source code was released as part of Humble Bundle awhile back. Not sure if they still distribute it. \$\endgroup\$ – Jovan Sep 21 '13 at 20:29
1
\$\begingroup\$

When I have used a repeating background image, I used two copies of the image side by side and scrolled the pair. When one gets to the edge of the screen, reposition it off the screen.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.