Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

neonstar

map scrolling trouble...

This topic is 6113 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

howdy folks, i''m currently writing a sidescrolling action game, and i''m having some odd troubles with keeping my characters level on the ground while the screen scrolls. i guess is should give you a bit of background. i wrote my map engine about a year ago, and i added a lot of advanced features to it. infinite layers, alpha depths, colored lighting, parallax scrolling, things such as that. since there are an unknown amount of layers and each layer will have a different parallax level, i had to give the map system a set of local scrolling functions. calling this would scroll the whole map for the desired amount and calculate any parallax and such. now that i have all that set up, i''m trying to use it in my game, and it''s all working well except for one pretty large problem: my characters won''t stand level on the ground if the map is scrolling up. the amount that the map scrolls is based on the delta of player movement since the last frame. the scrolling works fine for each other direction, but when the map scrolls up, it makes the ground work funny. the characters'' standing on the ground is determined by whether they are on top of or inside a walkable map tile at that point in the game loop. if they are inside of the map tile that is walkable, their position is recalculated so they are standing directly on top of the tile. when the map scrolls, it fucks up this calculation somehow, and the enemies that are standing give me a funky bouncing effect. the player doesn''t land right sometimes. when the map gets high enough that it doesn''t have to scroll up anymore, the effect goes away. disabling upward scrolling based on player movement makes the effect go away as well. i haven''t noticed any problem with downward scrolling, so something has to be going wrong to make it act like this. i know my description is really vague, but i''m just seeing if anyone understands or has had this problem before and can point me in the right direction. i''ve tried basically everything i know how to do. thanks, dave -- david@neonstar.net neonstar entertainment

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Come on! at least tell us how you fixed it!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!