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 / Can you help me to fix this code.

Author
Message
VesDev
14
Years of Service
User Offline
Joined: 11th Sep 2011
Location:
Posted: 28th Sep 2011 04:51
I'm new to programming. And we're currently creating a 2D game.
Can you help me to fix this code on how to run this program? Thanks.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 28th Sep 2011 05:36
I'll take a look at it and see what I can come up with.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 28th Sep 2011 05:47 Edited at: 28th Sep 2011 06:06
First off... I am just curious, what are you trying to accomplish with this program exactly?

Also, the first thing I noticed is that there's no "Return" at the end of "loadImages:", so it will keep going through "playerMovement".

Keep checking here often, as I'm still going through your code and I'll update this post.

EDIT1: Also, noticed no Return after "playerSprites:" too, so it goes through into "Vars:".

No Return after "playerBoundaryChk:" also.

Those are the ones that jump out the quickest at me. Without that last Return (playerBoundaryChk), it will continue until the end of your code (wait 10000).

EDIT: Whoops... also a return after "message" was needed. Once you put all those returns in, then you can see stuff, but it looks like it still needs some work.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 28th Sep 2011 05:59
Also, I noticed one place where you made "IF CONTROLKEY() = 2", which it will never equal 2.

And about those returns... What returns do is return you to the place in code where you last left off.

For instance...



If you had no "Return" there, you'd never see the "How are you?" printed to the screen because it wouldn't be called at all, and the program would go to the end. When you put the return there, that tells the program to go back to the last place in the previous code area you left off. I hope that makes sense.
VesDev
14
Years of Service
User Offline
Joined: 11th Sep 2011
Location:
Posted: 30th Sep 2011 04:37
Thanks for your replies.

I already try your suggestions. Thanks is helps. And, can I ask what is the problem when it is running but the characters cannot be seen and just see a blue/black screen in a few seconds? Thanks sir for the help. Hmm. Can i get your email address?
VesDev
14
Years of Service
User Offline
Joined: 11th Sep 2011
Location:
Posted: 30th Sep 2011 04:56
Thanks Sir it works! I already find the errors.

Can I get your email address Sir? I need some help. My email address is [email protected]. Thanks Again. God bless!
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 30th Sep 2011 09:32
Well, I honestly don't use my email much anymore. You'll mostly find me here though.

However, if you need my email it's [email protected]
VesDev
14
Years of Service
User Offline
Joined: 11th Sep 2011
Location:
Posted: 2nd Oct 2011 17:42
Ok sir. So, I need to be online here for your help and if i have questions. Thank you again.

Login to post a reply

Server time is: 2026-07-10 06:08:13
Your offset time is: 2026-07-10 06:08:13