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 / Players of the Crapibean 3: At wits end... My Game Hangs

Author
Message
illtempered mutated seabass
18
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 23rd Jan 2008 11:24
Hello everyone,
I have a seemingly small yet obscure problem in two parts. My 2D game is 99% done and these problems follow me like the plague. So I guess we'll start with a little about the game.

It consists of 5 small games of various types and includes a 'selection screen' to play the game you want individually or a 'Play All' mode. Each of the games work perfectly when played individually, and you can play through the entire set of 5 with 'Play All' one time, the second time through there is a small bug consisting of one of the enemies becoming "invisible" (you can still shoot them but you cannot see them, this only happens on the first enemy), and when you finish game 4 and game 5 starts to load the game hangs (can't use ESC or F12 in debug or the worse option when compiled completely freezes the entire system forcing you to use a hard reset).
After each game is played all sprites, variables, etc. are reset and/or deleted as necessary.
There are almost 2,000 lines of code, so I can't post all of it and the standalone (media included) is over 65MB.

My questions are:
1) What could be causing this?
2) Any ideas on where to look?

P.S. sorry about the ambiguity of my question, if I knew what the problem was I could probably fix it.

Thanks in advance for the help.
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 23rd Jan 2008 15:21
are you resetting all of the variables when you play through again? because if you have one where the enemy disappears when he's killed and you don't reset it then you won't be able to see him when you play again. That could be causing problems for the crash as well; maybe it's trying to create things which already exist or something.

"A West Texas girl, just like me"
-Bush
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Jan 2008 20:54 Edited at: 23rd Jan 2008 20:55
It's difficult to suggest what to do for this problem without everything installed and running on my machine in front of me, so I can only guess what the problem is.

My first guess is that you deleting a Bitmap and repeating a Get Image on an empty black screen without loading the image you want to grab from back in first. This would create a black - and therefore transparent - sprite as you describe.

So, make sure that at the start of EVERY mini-game you:

a) Reset all variables.*
b) Delete and reload all graphics then grab new images.
c) Delete and re-create all sprites.**

* To avoid problems, all vars in game 1 could start with M1_ for example and vars in game 2 M2_ and so on.

** A loop can quickly do this:



(Just set the 1 To 1000 range to match the sprite numbers you use).

Hope these suggestions point you in the right direction...

TDK_Man

illtempered mutated seabass
18
Years of Service
User Offline
Joined: 23rd Jan 2008
Location:
Posted: 25th Jan 2008 10:54
Thanks guys for the help I tracked down the 'Crash' culprit (I wasn't initializing a vairbale good and proper...)and have now begun on the little minor things in life.

I APPRECIATE IT!!!

Login to post a reply

Server time is: 2026-07-06 00:10:00
Your offset time is: 2026-07-06 00:10:00