Collision program

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Anonymous

Collision program

Post by Anonymous »

I need help making my program exit when to rectangles collide. thanks for any help

Archived topic from Iceteks, old topic ID:4123, old post ID:33693
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

Collision program

Post by Death »

Graham wrote: I need help making my program exit when to rectangles collide. thanks for any help
:blink: lol okay. Can you explain this a bit more in detail? Are the rectangles racing? Are they bouncing around the screen?

Archived topic from Iceteks, old topic ID:4123, old post ID:33700
Anonymous

Collision program

Post by Anonymous »

its a racing game but like frogger and there is 3 lanes when the car touch i want it to exit

Archived topic from Iceteks, old topic ID:4123, old post ID:33728
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

Collision program

Post by Death »

Okay, I know what you mean now. This is waaaaaay too difficult to explain without confusing anyone. I wrote 2 huge paragraphs but was unable to make it sound easier. I can't explain is in depth but all I can say is you need to set boundaries for your car and test to make sure that your car's co-ordinates aren't the same as another car's. If the coordinates are the same, that means they've collided. But it's much more complex than that because you car will have more than one coordinate. It'll have a range of co-ordinates because it's not a single dot you're checking. So you might be checking to make sure that car 1's x value isn't surpassing car 2's x value from the range of 1 to 100 (because your car is going to be taking up enough space). It's too difficult to explain without showing you in the actual editor. Your best bet is to ask your teacher or the class wiz for help.

Archived topic from Iceteks, old topic ID:4123, old post ID:33744
Locked