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.

DarkBASIC Discussion / Weird bug that I just can't fix...

Author
Message
Mr Underhill
23
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 27th Apr 2003 05:54
Ok, in my space game, I use an invisible collision sphere to keep the player from flying out of the starfield and into the white nothingness of the backdrop. When the player leaves the sphere, it runs a subroutine that makes the ship do a u-turn.

When I run the program for the first time since starting DB, the u-turn subroutine triggers automatically and repeatedly, making it impossible to move, let alone do anything. When I run it again without changing the code, everything runs fine. I have already tried to fix this bug, and i'm just short of throwing out the entire sphere idea. Is there a less drastic approach I can take?
"not all that is gold does not glitter, not all those who wander are lost, not all that is old does not whither, deep roots are not reached by the frost..." - Aragorn (Strider)
Chiwawa
23
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 27th Apr 2003 06:02
hmmm ...you are inside of the ..sphere.......
just use math collision..i mean..its a sphere..nothing more easy than math sphere collision...cause..maybe DB is thinking you are colliding the sphere cause you are in it...

you just need to know your middle point..and if your..ship is too far of it..do your stuff....
Mr Underhill
23
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 1st May 2003 10:25
hmm...good idea. I'll try it. Thanks!

"not all that is gold does not glitter, not all those who wander are lost, not all that is old does not whither, deep roots are not reached by the frost..." - Aragorn (Strider)
Mr Underhill
23
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 1st May 2003 10:29
Cool! I just tried math collision and it worked! FPS is up, too!
Thanks alot, Chiwawa!

"not all that is gold does not glitter, not all those who wander are lost, not all that is old does not whither, deep roots are not reached by the frost..." - Aragorn (Strider)

Login to post a reply

Server time is: 2026-06-12 06:56:06
Your offset time is: 2026-06-12 06:56:06