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.

Author
Message
Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 31st Oct 2011 04:37
I did this exercise from Hands on DBPro and I'm running into an odd issue.
I wrote in a main loop for the game for replay and the second time through the loop the program just hangs until i hit ESC.

Any clues?



Thanks!

~Aspiring~
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Oct 2011 16:34
I'm as baffled as you are.

As you say, it runs twice then hangs with a black screen for no obvious reason. I tried reorganizing a few things that shouldn't be in the main game loop but the symptoms were the same.

The code seems straightforward enough so I'll take a closer look.
Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 31st Oct 2011 16:44
Thanks for the help.
What did you try reorganizing in the main loop
global declarations?
InitializeGame() ?

I stuck the globals in the main loop in hopes that re-initializing them every loop would help. I also put in undim commands to destroy the arrays in case that was the issue. Not sure if any of that needs to be done.
I welcome your notes as I'm a beginner and I'm happy to learn from someone more experienced.

Thanks again for the assistance!!

~Aspiring~
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Oct 2011 17:07
Here's your problem. When you've filled the array with 1's the loop can never terminate.



Good luck with your coding.
Naphier
15
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 31st Oct 2011 17:20
Ah ha! Thanks.
That's a bad loop.
I'm starting to now remember something I used to know about programming: have an extra escape condition for loops!

*bows graciously*
I really appreciate the help!

~Aspiring~

Login to post a reply

Server time is: 2026-07-10 01:58:41
Your offset time is: 2026-07-10 01:58:41