# Displaying graphic on negative coordinations?(designing side-scroller)

This topic is 2247 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey, I'm planning to create a 2d side-scroller and was thinking how to design the landscape. Is it admissible to display certain objects on minus coordinations, like (-600, -100) etc? and by scrolling the map I would eventually come to such directions. I would like to implement it as good as possible so I would be very gratful for giving me the clues on how to design such a side scroller.

##### Share on other sites
There are a lot of tricks you can use, but you didn't specify which technology are you going to use for your side scrolling game.

As a specific answer, you have a fixed camera always showing the same coordinates, and you usually translate the background in front of the camera, not move the camera around to negative/positive coordinates. You could also use parallax scrolling for a nicer effect:http://en.wikipedia.org/wiki/Parallax_scrolling

##### Share on other sites
ye parallax scrolling might be something I was looking about. I want to have similar camera in my game as in Little Fighter 2.

##### Share on other sites
hmm Does anyone know any tutorials on how to use parallax scrolling / how to learn camera moving with directX? All I can find are some forums ;/

##### Share on other sites
There is no such thing as a "Camera" so what you want to do is the following

draw(x - camera.x, y - camera.y) // and everything you draw is treated this way even the background // then you adjust the camera to where the player xy is usually

##### Share on other sites
well I still don't get it and can't find any good explanation.
1. So I don't need to use any DirectX functions to make camera move like in side scroller?
2. So its all about moving every object on the screen with the same speed?
3. So if I want to display a chest lets say 2000 px further than current position, how should I do it? Should I display it all the time while game runs or only when character comes to the point where he can see it?
4. So an object having initial coordinations like (3000, 5800) in the game is common thing?

bump

##### Share on other sites
It can be thought of either way. You can either move the camera through the world, or you can move the world past the camera; it amounts to the same result, but uses a different reference point. Using negative coordinates is fine—orient your coordinate system however makes the most sense for your game.

If you're struggling with coordinate systems and moving your view around within a given coordinate system than you should be prepared to start with the basics. That's not a bad thing—everyone starts at the beginning. Just be prepared to spend significant tint getting to where you want to be. Most of what you find will be for Direct3D, but that's okay, because 2D is really just a special case of 3D.

##### Share on other sites
Thanks a lot for reply. I just still can't find answer on my 3th and 4th question above. I mean how are maps for 2d side scrollers designed? There are .txt files which store initial cooridinations of every rendered object, so that for example sth is rendered on (2000, 3000) position? But I guess it would be hard to design a landscape by putting coordinations for an object just by guess?
I would extremaly grateful for explaining me those things, but please do it precisely ^^

• 10
• 13
• 14
• 18
• 15