0
\$\begingroup\$

I am making a 2D top-down game in Java using the Slick2D library. However, this question applies to all ways of making games of this nature.

My question is: How would I do a background for the world. Currently it looks like this: Dodgy Background

Obviously, this isn't the best example, as the right side has an area that allows the player to walk into the 'background'. However, I am asking how this is done in other games, such as Pokemon.

\$\endgroup\$
  • \$\begingroup\$ Possible duplicate: Stop map from scrolling but let player still move? \$\endgroup\$ – MichaelHouse Sep 16 '13 at 15:54
  • \$\begingroup\$ It's not a duplicate, but the method defined in that question is a valid way of tackling my problem, thanks. You could make that an answer, just that I could stop scrolling, and I'll mark it as accepted. \$\endgroup\$ – George Raven Sep 16 '13 at 16:30
1
\$\begingroup\$

If you're working on a plain style map, you can either stop the map from scrolling and make the player move "beyond" the center of the screen OR stop the map from scrolling BEFORE you've reached your limit minus half your screen size.

\$\endgroup\$
  • \$\begingroup\$ This is a very good solution, and I have implemented it. \$\endgroup\$ – George Raven Sep 17 '13 at 19:53
1
\$\begingroup\$

If you don't want to use the method Byte56 linked, another option is to just make a bigger map. You don't have to put transition points right at the edge of the background. If you can see up to 20 tiles away, ensure that the "playable area" of the map is within a 20 tile border of the map. Note that this can be a bit jarring/annoying to players if you don't somehow make it very visually clear where the transition point.

Games like Neverwinter Nights (2002 version) would automatically extend a tiled map out but shade out the extended area. Thus a pathway that led right up to the "edge" of a map wouldn't just end in darkness but would visually appear to stretch out into the fog. The darkened shader along with NWN uses a clickable highlight region for transition areas made it clear and obvious where these transitions were but also make the map edges look less like an entire map was inside a box and instead part of an expansive, endless world.

\$\endgroup\$
  • \$\begingroup\$ Thanks for your help. I actually was inspired for a 'dark' style game by your answer. I just kept thinking about that. I think I'll use this in that if I bother making it. \$\endgroup\$ – George Raven Sep 17 '13 at 19:54
0
\$\begingroup\$

There's also approach Heroes of Might and Magic chose - they render a border around the map and fill the abyss with stone texture:

enter image description here

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