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 Professional Discussion / Game Crashes Randomly

Author
Message
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 29th Mar 2010 00:06
I have been programming a quick little game in my spare time. For some reason it just randomly crashes with "Circle Man.exe has encountered a problem and needs to close. We are sorry for the inconvenience." I don't know why this is happenning. For some reason it does this after I start shooting at the enemies.
This is all of my code and I attached the media.


If it hasn't exploded yet, I haven't touched it.
jfroco
16
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 29th Mar 2010 06:28
Hello,

Tested for a couple of minutes and it didn't crash.

I attached the exe I compiled.

Best regards
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 29th Mar 2010 11:17
I can`t actually compile it, but the code seems to be ok.Looks very clean.There is error when i try to compile, in this part:

at line where sprite exist is checked, it says that can`t be equal 0.Strange...

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 29th Mar 2010 16:26
That is quite wierd since it checks


If it hasn't exploded yet, I haven't touched it.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Mar 2010 16:31 Edited at: 29th Mar 2010 18:40
Compiled and ran fine for me. No crashes. Ran smoothly till I got bored trying to work out what was making my Health drop. Looks like a good start to a simple, easy to play, game.

Edit Just peeked at the code - now know why my health was dropping.

Edit2 OK, spoke too soon. It just crashed as I was trying to work out why my health was dropping when I didn't seem to have been hit by anything. This was happening when enemies appeared very close to the top left hand corner near the blue circle - and just as I realised this a green sprite appeared in the left hand corner and the program crashed. I'll have another look at the code to see if I can see anything wrong.

Edit3 No ideas yet. But I do have a suggestion to aid debugging. Change randomize to use a fixed start point for the random numbers - this might make it easier to follow through the logic when an error occurs and, with luck, will make the problem reproducible (as long as you don't change anything by pressing keys, etc, ...).

Edit Bit of a long shot: could the repeated creation and deletion of sprites be causing problems? Do you get the same problems if you use the pair "hide sprite"/"sprite visible" instead of "delete sprite"/"sprite exist"?

Login to post a reply

Server time is: 2026-07-26 21:12:26
Your offset time is: 2026-07-26 21:12:26