Page 1 of 1

Mapeditor and Collisons

Posted: Fri Dec 09, 2011 5:46 pm
by dar0n123
+

Re: Mapeditor and Collisons

Posted: Fri Dec 09, 2011 6:50 pm
by Jack5500
Hey,
If you want to learn how to make tile-based maps, you should check out these great tutorials: https://github.com/kikito/love-tile-tutorial

I've made a map, but I have a problem with collision and my basic question would be which approach to choose. It's supposed to get a platformer (jumping, dieing in gaos etc) and my quetion now would be if I should use physics or stick to pixel movement. Can someone provide a good link to a good approach?

My Code by now, without the "coordinate-movement" player:

http://pastebin.com/F505QxbV

Re: Mapeditor and Collisons

Posted: Fri Dec 09, 2011 7:43 pm
by dar0n123
+

Re: Mapeditor and Collisons

Posted: Fri Dec 09, 2011 8:00 pm
by Jack5500
TechnoCat wrote:I responded to a PM about using Noah's Ark to learn about sidescrolling and I thought my response could help the general public.
TechnoCat wrote: I'm glad you like my Noah's Ark game!

However, I strongly encourage you not to use any of Noah's Ark code and to merely look at it. I wrote that code and created all the graphics during a 48 hour gamejam. It is really messy and really hardcoded! Like you said, take out one thing and it all falls apart.

There are 4 paths to collision detection and resolution for sidescrollers that I will recommend.
  • Use Fizz (or similar, of which I am aware of no others)
    1. This library was written specifically to be a drop-in solution to making a sidescroller.
    2. Lightweight
    3. Very easy
    4. Might not have all functionality (It tries to be a single solution)
  • Use Hardon Collider (My personal favorite path)
    1. This library is written to purely be a collision detection library, not a collision resolution library. However, detection is the hard part.
    2. Lightweight
    3. A little bit of difficulty. (requires you read the HC API)
    4. Very robust (this library makes almost no assumptions)
  • Implement a versatile collision detection library (such as Metanet's)
    1. To do this you are going to need a really good understanding of Linear Algebra
    2. You'll still have to resolve collisions after you implement this.
  • Use Box2D
    1. Box2D is often considered unsuitable for sidescrollers. But, Kurosuke and some others get away with it.
    2. love.physics is actually Box2D
I hope this helps you get started.