Page 1 of 2

Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 12:13 pm
by Kuromeku
Well, I worked from Rude's collision .love file and improved it a lot more and I've developed a nice little alert system too.

I'd be great to this this simple alert system in some games so feel free to use it with credit.

Re: Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 1:36 pm
by rude
That's cool! But you need to package the .love with the code files at the root, otherwise it won't work.

(BTW, your coding style is very clean and readable! ^.^)

Re: Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 2:24 pm
by Kuromeku
Thank you Rude, sorry for the problems before.

Re: Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 2:37 pm
by Kuromeku
Hey Rude, what's the best way of doing collision with 2D boxes as oppose to circles?

Thanks.

Re: Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 3:34 pm
by Kuromeku
here's a newer version

Re: Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 5:17 pm
by rude
I don't know the best way, but I've used SAT successfully before. If the boxes are axis-aligned (not rotated), you just have to check two axes.

Re: Here's a present to those that hate me.

Posted: Thu Aug 21, 2008 5:51 pm
by qubodup
We don't hate you. We LÖVE you.


Thank you, thank you. That was me: stating the obvious!

Re: Here's a present to those that hate me.

Posted: Fri Aug 22, 2008 5:08 am
by Xfcn
I don't hate ya, dude. I'm too lazy to hate. Great demo. I'd love to see a break-down of the code in Tutorial form. :D

Re: Here's a present to those that hate me.

Posted: Fri Aug 22, 2008 8:43 am
by ivan
I don't know the best way, but I've used SAT successfully before. If the boxes are axis-aligned (not rotated), you just have to check two axes.
I did quite a bit of programming with AABBs and circles which was eventually scrapped from AGen. AABBs can be quite complicated if you're doing sweeping intersection tests. It also depends on the amount of information you want to gather about a particular collision. For example, do you need to know the exact time of intersection (TOI) or the point of intersection or the normal between the two colliding objects the penetration vector, etc, etc. It all depends on the kind of collision response you want to have in your game and will dictate the 'best' algorithm for the job.

Re: Here's a present to those that hate me.

Posted: Fri Aug 22, 2008 11:17 am
by Kuromeku
I don't need anything too informative, I simply need to know if there was a collision and maybe a way to resolve collisions for rectangular objects.

Rude gave me some pretty code for finding and resolving collisions with circles, but what about finding and resolving collisions with squares, or cicles and squares?