Collision

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
BobTheLawyer
Prole
Posts: 5
Joined: Thu Sep 20, 2012 11:57 pm

Collision

Post 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...
User avatar
master both
Party member
Posts: 262
Joined: Tue Nov 08, 2011 12:39 am
Location: Chile

Re: Collision

Post 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
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Collision

Post by Lafolie »

Please try doing a forum search. There's a lot of content related to that.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
BobTheLawyer
Prole
Posts: 5
Joined: Thu Sep 20, 2012 11:57 pm

Re: Collision

Post 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.
User avatar
Nsmurf
Party member
Posts: 191
Joined: Fri Jul 27, 2012 1:58 am
Location: West coast.

Re: Collision

Post 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:
OBEY!!!
My Blog
UE0gbWUgd2l0aCB0aGUgd29yZCAnSE1TRycgYXMgdGhlIHN1YmplY3Q=
User avatar
master both
Party member
Posts: 262
Joined: Tue Nov 08, 2011 12:39 am
Location: Chile

Re: Collision

Post 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?
Attachments
example.love
(482 Bytes) Downloaded 141 times
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Collision

Post 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.
User avatar
master both
Party member
Posts: 262
Joined: Tue Nov 08, 2011 12:39 am
Location: Chile

Re: Collision

Post 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
Attachments
class.lua
This one, but have no idea what it is.
(1.38 KiB) Downloaded 142 times
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests