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
Takeshii
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location:
Posted: 15th Sep 2005 05:58
i dont see why this doesnt work :? (im only going to show a fradment of my code)


(declareing a variable)
start = 1

(in game loop)
DO
~
IF start = 1
SPRITE 4,100,100,4
start = 0
ENDIF
~
LOOP

Hmmm... what i want it to do is execute once everytime something changes start to 1, but initially have it as one, so it does that at game start.

Dark
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 15th Sep 2005 07:28
So, do you have start =1 ANYWHERE in your loop, or whats the problem? I don't see why that wouldn't work? I'm stumped....

------------------------
Visit my website of games
http://www.dabip.co.nr!
Takeshii
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location:
Posted: 15th Sep 2005 07:43 Edited at: 15th Sep 2005 07:44
its exactly as shown except wheras "~" is the rest of my code which im not going to show

edit, yes i do have start = 1 in other areas of code, but it should start initially, wich its not.

Dark
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 15th Sep 2005 07:55
IF you can, try putting the code at the VERY beginning of your game loop. I tried code that I typed up similiar to yours and it worked for me. Heres the code I used :


------------------------
Visit my website of games
http://www.dabip.co.nr!
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Sep 2005 09:34 Edited at: 15th Sep 2005 09:37
Dark Programmer,

There is no reason your code should not work, unless your installment of DarkBasic is bugged. A fresh reinstall may solve this type of problem.

On the other hand, it seems as if the code you posted above was freshly typed up for this thread, and not just a paste of a copied section of the code within your editor. Therefore, your source code could me mistyped.

Also, check if there is a line of code before this piece of code which is ALWAYS switching start to equal 0. This is a common bug.

On a last note, you might want to show more of your code if you wish for more effective help. With only the code you have presented to us, we only have the ability to theorize or suggest on what the problem might be. Just a wise note.



+NanoBrain+
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Sep 2005 13:37
As Nanobrain says, it's impossible to help you with the code you provided because we have no way of knowing what your program does between setting Start to 1 and reaching your If Start = 1 line.

It might be setting Start back to 0 somewhere.

Put an End on the line before IF start = 1 and run it. When you drop into the CLI, type

Print Start

and see what Start is equal to the very first time your program runs.

That's all I can suggest with what you've provided I'm afraid...

TDK_Man

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Sep 2005 22:41 Edited at: 15th Sep 2005 22:42
I agree with NanoBrain and TDK. Trying to debug code with key parts taken out is like trying to pick your nose with both your hands tied behind your back. Post it again with everything between the do/loop and anywhere "start" is... if you really want help.
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 15th Sep 2005 23:44
Maybe "~" (the rest of your code) is the reason.
There is nothing wrong.

[href][/href]
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 16th Sep 2005 21:49
Make sure Image 4 is loaded properly, and any needed 'Sync' commands are in place.

Part of the 'Emergency Response Noob Shooting Team' :: Feel free to add me to MSN, but don't expect any big favours.
I AM _NOT_ A MOD, I AM ONLY HUMAN (although I fly in my spare time).

Login to post a reply

Server time is: 2025-05-22 09:27:18
Your offset time is: 2025-05-22 09:27:18