Jump to content
  • Advertisement
Sign in to follow this  
stycho

scrolling map made of tiles?

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

I am planning to make an RPG with SDL and was wondering how to make maps out of tiles and how to make them move while my character stays in the middle animated walking.

Share this post


Link to post
Share on other sites
Advertisement
You kinda answered your own question ;) Draw your character always in the middle of the screen (using different sprites for different facing directions, etc). Each time the character is supposed to move, loop through all of the tiles on the screen and move them in the direction opposite of that which the character is facing by simply interpolating them between their starting position and their desired new position over a short period of time (so the motion is smooth).

I have some code which does just that, however its written in C#/Managed DirectX. The priciples are, naturally, the same, though. If that's something that you'd find useful, let me know and I'll zip that project up for ya. Hope that helps :)

Share this post


Link to post
Share on other sites
Thanks so much for the reply! I'm absolutely brand new to game programming and SDL so I wouldn't know how to do it. I would love to look at your code and try to figure this out. thing is, I don't know how to make a tile set or even how to use one once I had one made. I can just blit sprites on the screen and kinda move them. If you have any help to offer that would be great!

Share this post


Link to post
Share on other sites
Here are some tutorials...

http://www.xnaresources.com/pages.asp?pageid=8

I know your not using C# or XNA but the technique is still the same.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Instruo
Each time the character is supposed to move, loop through all of the tiles on the screen and move them in the direction opposite of that which the character is facing


Here in Finland we have a joke that goes like this:
Q: How many X are needed to change lightbulb?
A: 100, one holds the lightbulb while the rest 99 rotates the house.
Replace X with whatever you want to make fun of :)

I think (I have not done any research) a more common method is to have an offset from where you draw your current screen and when moving character you adjust the offset accordingly. IMHO that's a lot more intuitive way.

Share this post


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

  • 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!