Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / why cant i solve this problem?!

Author
Message
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 18th Mar 2009 09:22
hey again,

I've been strugling with the same problem for ages now, and i can't get it fixed.

when two spheres collide it should make a new one that behaves the same as the others. all it does is create a new one which just sits there.



Please help,

David

True geeks live forever, or die trying.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 18th Mar 2009 09:41
The design of your code makes following what's happening very difficult, you aren't even initializing all those arrays you create so I wouldn't be surprised if random values cause lots of problems when you run this without debugging. Please use classes or structs to store all of this relevant info in well-named containers otherwise it's just a pointless back and forth trying to figure out what everything does.

Bruce Dudeson
15
Years of Service
User Offline
Joined: 17th Mar 2009
Location:
Posted: 18th Mar 2009 10:39
I agree your code is hard to follow I'd make a sphere class holding the data for the sphere. Also maybe more descriptive variable names.

For starters this loop is only going to happen once, because you never reset your counter.


Also
is outside of the loop so it gets increased every loop. Though it doesn't even matter because in your if statement you set it to Sm.

Login to post a reply

Server time is: 2024-11-25 16:57:07
Your offset time is: 2024-11-25 16:57:07