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\$
2
  • \$\begingroup\$ Linear wrapping should do the trick. \$\endgroup\$ Commented Jul 4, 2013 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
    Commented Sep 21, 2013 at 20:29

1 Answer 1

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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .