Advertisement Jump to content
Sign in to follow this  

Game environment collision

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

Hello everyone!

I wonder what collision method for environment is used in most games today. I've been thinking and searching for information quite a while now, but still not sure if I'm right or not. I will explain my thoughts on Rayman: Origins example (because this is what I want to achieve)

I think that this game has a trail on which character moves

My guess is that its made of lines connected to each other and game logic calculates slope of the line to determine point of a trail.

So am I right or there is another more efficient way to do this?
I believe Nevermore game uses the same method.

Maybe there is a book or tutorial on such topic?
Thanks for any help!

P.s. I will need to make floating grounds like this as well

Share this post

Link to post
Share on other sites
Try Box2D and look for the 'prevent rotation' (or the like) setting on the fixture or body definitions (im sorry, I just had forgotten).

Hope this might help (look at the tutorials first!).

Share this post

Link to post
Share on other sites
One of the things you could do (and one of the neater methods I've seen executed well) is represent the map by two parts: the map and the collision texture.

Yes. Texture. :) You could draw up a texture map in which all non-alpha/arbitrarily chosen colored pixels could be used for collision data.

The collision texture:

The map you see in the game:

You can then check for collisions but referencing the texture data at the coordinates the player has landed on, do some per-pixel detection and linear smoothing, apply pseudo-physics, and there's your general idea. :)

This is just one way you could go about doing something like this.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!