Jump to content

  • Log In with Google      Sign In   
  • Create Account

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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 savail   Members   -  Reputation: 333

Like
0Likes
Like

Posted 23 March 2012 - 08:17 AM

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.

Sponsor:

#2 meeshoo   Members   -  Reputation: 508

Like
1Likes
Like

Posted 23 March 2012 - 08:56 AM

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

#3 savail   Members   -  Reputation: 333

Like
0Likes
Like

Posted 23 March 2012 - 09:10 AM

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

#4 savail   Members   -  Reputation: 333

Like
0Likes
Like

Posted 23 March 2012 - 10:02 AM

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 ;/

#5 Kristoffer   Crossbones+   -  Reputation: 839

Like
0Likes
Like

Posted 23 March 2012 - 12:46 PM

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

Blekinge Institute of Technology
Twitter @devmoon
Homepage http://devmoon.se
Stream http://twitch.tv/devmoon

#6 savail   Members   -  Reputation: 333

Like
0Likes
Like

Posted 23 March 2012 - 01:26 PM

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?

#7 savail   Members   -  Reputation: 333

Like
0Likes
Like

Posted 24 March 2012 - 02:00 PM

bump

#8 yckx   Prime Members   -  Reputation: 1291

Like
0Likes
Like

Posted 25 March 2012 - 02:10 AM

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.

#9 savail   Members   -  Reputation: 333

Like
0Likes
Like

Posted 25 March 2012 - 01:34 PM

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 ^^




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS