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 / How do I end my game when...

Author
Message
Azh321
21
Years of Service
User Offline
Joined: 28th Oct 2003
Location:
Posted: 28th Oct 2003 23:42
I want my game to exit or end when I press a button, space for example. I have tried, here is what I did:

Hallo Weibchen
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 29th Oct 2003 00:03


Here's some code you can quickly experiment.
Post if you need more help.



A book? I hate book. Book is stupid.
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 29th Oct 2003 00:25
just use the command EXIT



GameKit
22
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 29th Oct 2003 16:09
I think the only thing you are doing wrong is you are forgeting the () after the spacekey... you had...
If Spacekey=1 Then End
...It should be...
If Spacekey()=1 Then End
Without the (), it treats spacekey as a variable... so it is naturally 0, unless you specify in your code spacekey=1...you were telling the computer If variable=1 then end...the () is a way of telling the computer to find something...well...i hope that helps...

If It Wern't For Bad Apples, Good Apples Would Only Be Average...

Login to post a reply

Server time is: 2025-05-21 09:53:29
Your offset time is: 2025-05-21 09:53:29