Here's a present to those that hate me.

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.
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Here's a present to those that hate me.

Post 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.
Attachments
envy.love
(3.82 KiB) Downloaded 190 times
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

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

Post 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! ^.^)
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post by Kuromeku »

Thank you Rude, sorry for the problems before.
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post by Kuromeku »

Hey Rude, what's the best way of doing collision with 2D boxes as oppose to circles?

Thanks.
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post by Kuromeku »

here's a newer version
Attachments
envyph1.love
(7.22 KiB) Downloaded 186 times
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

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

Post 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.
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

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

Post by qubodup »

We don't hate you. We LÖVE you.


Thank you, thank you. That was me: stating the obvious!
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
Xfcn
Citizen
Posts: 65
Joined: Sat Jul 12, 2008 6:53 am

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

Post 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
"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

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

Post 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.
User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

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

Post 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 235 guests