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 / holding down the key problems

Author
Message
Maxmax123
17
Years of Service
User Offline
Joined: 11th Feb 2008
Location:
Posted: 9th Aug 2008 21:00
Ive already tryed to find the solution on the forums before but nothing is working right.

heres some psudocode

if returnkey()=1 and helddown1=0
do whatever just once in a loop
helddown1=1
else
helddown1=0
endif

im using functions with loops inside then

could someone possibly help me get this right?

this is a trick I really need to know
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Aug 2008 21:50 Edited at: 9th Aug 2008 21:51
Firstly, put your code in a code snippet be highlighting it and clicking the "code" button at the top right

You will get a cool box like this:



OK, now to your problem:

Try changing



to



With your code, it will never get to the "else", because it`s waiting for the returnkey to equal 0, and the helddown1 to equal 1. And that will not occure.

TheComet

Suicide is away of telling God, You can’t fire me I quit !!!!!

Login to post a reply

Server time is: 2025-06-07 06:40:18
Your offset time is: 2025-06-07 06:40:18