Jump to content
  • Advertisement

Archived

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

computer_guy

tile collision

This topic is 5529 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, I''m trying to make a 2d side-scroller and am wondering how I would do tile collision. Could someone tell me or direct me to a good resource. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
It''s depends how you move your character, how your character is presented (a circle, a rect)...
how you move your character? 1 pixel at time or one tile at time?

Share this post


Link to post
Share on other sites
Each tile should have a "Walkable" property. If the character is on tile 2,3 (x,y) and the player is trying to move him to the right (3,3) then test that tile for walkability. If it''s walkable move the character, otherwise don''t.

Share this post


Link to post
Share on other sites
So should each tile be an instance of a structure which has propertys in it. If so, won''t that make a hell of a lot of instances.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
how would this be done if your moving one pixel at a time?

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!