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 / Problem with my code

Author
Message
Kamon
21
Years of Service
User Offline
Joined: 26th Apr 2003
Location:
Posted: 27th Apr 2003 04:51
Im just testing out what i have learned by making a simple Pac-man spoof, but I'm having a problem with the code. When I run the code it is fine up until "go sub Make_Ghosts" at that point it freezes. If I take out my main loop it will run fine. No matter where i put my main loop at in the code it freezes. Any suggestions on why its doing that?

Thanks
Kamon
21
Years of Service
User Offline
Joined: 26th Apr 2003
Location:
Posted: 27th Apr 2003 04:54
Taking a look at the code I posted I see the "\" where left out in some lines. In my code load bitmap "imageslogo.bmp",1 and load bitmap "images\ghost.bmp",2 have the back-slashes

Kamon
21
Years of Service
User Offline
Joined: 26th Apr 2003
Location:
Posted: 27th Apr 2003 17:15
No one knows??
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Apr 2003 19:41
Whoa, slow down there matey. Because we are volunteers, sometimes you will have to wait for hours before someone gets a chance to look at your problem.

It's probably working OK behind the scenes, but you are not telling DBPro to update the display. Put a 'sync' command just before the end of your main loop.

I haven't looked at the whole program, so there may be other problems. Just repost if there is and you can't figure it out.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Apr 2003 20:03
Don't know, but try REMing out blocks of code until you find the culprit.

Divide and Conquer...Debugging is all about narrowing down the area that the problem resides in.

Thanks in advance.
All the Best,
StevieVee
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 28th Apr 2003 03:17
Also go through your game using the debugger in step through mode? Then you know exactly where it is crashing in your game.. you are probably already done/doing this, but worth a mention.

I hear and I forget. I see and I remember. I do and I understand.
Kamon
21
Years of Service
User Offline
Joined: 26th Apr 2003
Location:
Posted: 28th Apr 2003 03:35
This is where it gets nuts.....

i do have a sync command at the end of the main loop

i know who the culprit is---the main loop. if i take it out of the program it runs fine.

this next one is weird....when i run it through the debugger in step through mode, its fine, just goes slower when i get to the sub "Make_Ghosts"

any other suggs. are GREATLY appriciated. i have spent hours upon hours debuging this and i cant figure it out :-s
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2003 08:19
This is your main loop:

rem Main loop
do
if upkey()=1 then y=y-5
if downkey()=1 then y=y+5
if leftkey()=1 then x=x-5
if rightkey()=1 then x=x+5
sprite 1,x,y,1
loop

No sync there. Have you put it in since your original post?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Apr 2003 08:23
just before the loop add sync

if using DBP u can also deploy a fastsync command

Login to post a reply

Server time is: 2024-11-24 12:37:55
Your offset time is: 2024-11-24 12:37:55