Page 2 of 2

Re: Half working collision engine

Posted: Thu Mar 18, 2010 7:41 pm
by Bullet Pulse
eatcomics wrote:Mine are the same, almost. You see, my boxes collision checking isn't the best. When a collision is detected, the box currently being checked gets the x and y velocities of the box that they are touching, the problem is with multiple blocks the velocities don't change to zero, because there is a collision, even though they aren't moving. I know this because I've noticed that if you get a cluster of boxes, and touch them, they rocket in a certain direction... Why they stay still when their velocities aren't zero is beyond me... Here is my code

(this is uncleaned, all in one file, horrible to look at, and may cause cancer...)
My code has changed a good bit since I posted the last revision.
I'm not using velocities, so I can't answer for the problem in your code.

I think I'm going to just leave this project alone for a while, and work on new things.
I could possibly go insane if I keep working on this lol.

Re: Half working collision engine

Posted: Thu Mar 18, 2010 7:50 pm
by eatcomics
Lol, I might work on it here and there, I was doing it just to see if I could help you :D but yeah... these programs have some weird behaviors though...

Re: SDL Collision Demo

Posted: Mon Mar 22, 2010 11:06 am
by Falco Girgis
eatcomics wrote:pretty sweet
Y'know, I would really appreciate it if you actually read topics before responding to them.

Re: SDL Collision Demo

Posted: Tue Mar 23, 2010 5:36 pm
by eatcomics
GyroVorbis wrote:
eatcomics wrote:pretty sweet
Y'know, I would really appreciate it if you actually read topics before responding to them.
Y'Know, you changed the post!

Re: Half working collision engine

Posted: Thu Mar 25, 2010 11:59 am
by xiphirx
Not really sure if this is solved, but I'll put this here anyway...

Code: Select all

return (abs(r1->x-(r2->x))<40 && abs(r1->y-(r2->y))<40);
// ASSUMING THAT THE PARTICLES ARE 40x40