Page 1 of 1

Collision

Posted: Thu Sep 20, 2012 11:58 pm
by BobTheLawyer
Is there an easy way to make collision?
I really would like to find an easy collision method that works well and is compatible with Bartbes Class.lua...

Re: Collision

Posted: Fri Sep 21, 2012 4:15 am
by master both
if you have problems with hardon collider or you want a more basic collision system, i recomend you to use this simple function from the wiki :https://love2d.org/wiki/BoundingBox.lua

Re: Collision

Posted: Fri Sep 21, 2012 5:35 am
by Lafolie
Please try doing a forum search. There's a lot of content related to that.

Re: Collision

Posted: Sat Sep 22, 2012 6:55 pm
by BobTheLawyer
master both wrote:if you have problems with hardon collider or you want a more basic collision system, i recomend you to use this simple function from the wiki :https://love2d.org/wiki/BoundingBox.lua
Thanks, but can I please see an example in a .love or folder format? (using class.lua)
That would be so incredibly helpful!
Lafolie wrote:Please try doing a forum search. There's a lot of content related to that.
I did. I am pretty new to forum searches, so I couldn't really find what I was looking for easily.
If you find something covering what I ask, by all means, I would LÖVE to know.

Re: Collision

Posted: Sat Sep 22, 2012 8:04 pm
by Nsmurf
Why not just make your own (simple) lib?

it isn't to hard to make a collision function for rectangles colliding with rectangles, or circles colliding with circles. Plus, if you make your own, you will totally understand it, and the theory behind it.

if you really want to use a pre-made lib, most of them come with demos, but I still suggest that you start by trying to make your own, even if you do end up using a lib later, it will help you understand whatever lib you are using a lot!

Good luck! :awesome:

Re: Collision

Posted: Sun Sep 23, 2012 3:35 am
by master both
Here is a very simple example, is a box falling.
So, basicly, what the function do is to detect if the box is touching the floor.
also, i dont know how to use "class.lua"

btw are you from the mari0 forums?

Re: Collision

Posted: Sun Sep 23, 2012 8:41 am
by Roland_Yonaba
master both wrote:Here is a very simple example, is a box falling.
So, basicly, what the function do is to detect if the box is touching the floor.
Seems to be working properly.
master both wrote: also, i dont know how to use "class.lua"
What's class.lua ?
If you're looking how to create classes, you can have a look here, there's some explanations.
You also have lots of advanced libs for OOP: MiddleClass, 32log, 30log, SECS, and a lot more, just search.
Hope this helps.

Re: Collision

Posted: Sun Sep 23, 2012 7:11 pm
by master both
Roland_Yonaba wrote: What's class.lua ?
If you're looking how to create classes, you can have a look here, there's some explanations.
You also have lots of advanced libs for OOP: MiddleClass, 32log, 30log, SECS, and a lot more, just search.
Hope this helps.
I have never used classes in lua, but i think that BobTheLawyer was talking about the class.lua used in Mari0.
EDIT: lol, i recently dicover that is the SECS system :P