Half working collision engine

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
Bullet Pulse
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 89
Joined: Sun Feb 21, 2010 6:25 pm

Re: Half working collision engine

Post 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.
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Half working collision engine

Post 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...
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: SDL Collision Demo

Post by Falco Girgis »

eatcomics wrote:pretty sweet
Y'know, I would really appreciate it if you actually read topics before responding to them.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: SDL Collision Demo

Post 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!
Image
User avatar
xiphirx
Chaos Rift Junior
Chaos Rift Junior
Posts: 324
Joined: Mon Mar 22, 2010 3:15 pm
Current Project: ******** (Unkown for the time being)
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Half working collision engine

Post 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
StarCraft II Zerg Strategy, open to all levels of players!

Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of :)
Post Reply