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.

Newcomers DBPro Corner / collision detecting wont let level load

Author
Message
Sickly
15
Years of Service
User Offline
Joined: 14th Jul 2009
Location: Does it matter?
Posted: 7th Sep 2009 11:16 Edited at: 8th Sep 2009 01:57
Im working on my first game, doing good so far, trying to add Collision detection though. when i compile and run, it brings up the screen, but stays black. never loads the level. I've read TDK's tutorial, which is what im going with for now, but cannot figure out why it wont load. This is the code i have thus far



Any help would be appreciated..

i forgot to mention, that when taking the collision detection code out, it loads fine.




NeverMind. went to a different tutorial about sparky's collision DLL. works perfect.

The darkest minds, are often the brightest.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 9th Sep 2009 03:33
The problem is that your program is getting stuck on the REPEAT loop at line 71. The object is colliding with something at the start, so the REPEAT loop triggers. However, because speed#=0, the object never moves out of the collision, so the program never leaves the REPEAT loop. Just giving speed# a value should help with this.

Little side note, you could replace that REPEAT loop and IF statement with a WHILE loop:





Sickly
15
Years of Service
User Offline
Joined: 14th Jul 2009
Location: Does it matter?
Posted: 11th Sep 2009 19:46
aah.. look at that. thanks man. I did however change my CDetection to sparky's dll. As i posted above. I will note this though incase i have a future issue similar.

The darkest minds, are often the brightest.

Login to post a reply

Server time is: 2024-11-24 01:48:04
Your offset time is: 2024-11-24 01:48:04