Sign in to follow this  

relative movement of layers on Platform Game

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all.

i would like to ask some opinions on handling movement for layers of different depths in a platform game. take for example 3 layers:
0 -> main objects and character movement through platforms.
1-> mountains, landscape, etc.. and visual decorations as background.
2-> clouds and very far objects, the last visuals for the scene.

right now i'm just using a render method in which i take the movement for first layer (based on the movement for the character controlled by the user) and multiply it by a factor
to reduce the motion of the layer that is supposed to be at a distance from the main layer. and for the last one, a similar process or no movement at all.

What other methods can be used to achieve this?, looking to have a natural perception, also based on what most platform scroller games out there use.

Share this post


Link to post
Share on other sites
You could also apply a scaling transform before drawing each layer. You would have to draw your images at different sizes so they look correct, but it would effectively change the coordinate system for the back layers so that it takes a bigger difference in position to have an equivalent shift.

Share this post


Link to post
Share on other sites
I can't offer specific help, but the thing you are talking about has the name Parallax scrolling ( [url="http://en.wikipedia.org/wiki/Parallax_scrolling"]http://en.wikipedia.org/wiki/Parallax_scrolling[/url] ). Said article contains different techniques. It looks like you're using the 'layer method' described therein. It seems like your method is probably the most straightforward to implement.

Share this post


Link to post
Share on other sites
[quote name='nobodynews' timestamp='1297382285' post='4772616']
I can't offer specific help, but the thing you are talking about has the name Parallax scrolling ( [url="http://en.wikipedia.org/wiki/Parallax_scrolling"]http://en.wikipedia....allax_scrolling[/url] ). Said article contains different techniques. It looks like you're using the 'layer method' described therein. It seems like your method is probably the most straightforward to implement.
[/quote]


Thanks for the link!.
wikipedia to the rescue.


Share this post


Link to post
Share on other sites
Sign in to follow this