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 / Useing arrow keys.. do they need to be flushed?

Author
Message
Colin Hart
21
Years of Service
User Offline
Joined: 28th Apr 2003
Location: United Kingdom
Posted: 5th Jun 2005 23:18
Afternoon all.

I have simple program at the moment, the problem is my mind is simpler.... any way moving on. I have pasted the code example in, basicly when I run this program the loop which controls the direction of the sprite works one time. The loop continues however when I press the "left arrow key" nothing happens after the first pressing??

Do I need to reset the value or am I missing the point totally?

Any help would be greatly appreciatred.

Colin.
ReneGade RG
19
Years of Service
User Offline
Joined: 13th May 2005
Location:
Posted: 6th Jun 2005 00:13
do
if leftkey()=1 then gosub main_loop
loop

it is pretty simple

It's amazing you're reading this, surprise... you still are.
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 6th Jun 2005 00:33
ReneGade: Sorry mate that made no sence.

Colin: Ok man, well like so many errors the code is doing exactly what you told it to...it is rotating the sprite to the 5degree mark...so next time you press the key it does it again.

However if you store the angle



Try that out and you should get the effect you are after.
Hope it helps

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 6th Jun 2005 01:15
i remember this problem when i was first trying to animate something, it wouldnt stop animating after i pressed the key the first time . I dont know if this is the same, but i finally figured out that i needed "if upkey()=0" statement so try:

dont know if this will work, i dont quite understand ur problem

Video games…they take you places unreachable, unfeasible. Putting you in the book...putting you in the movie...putting you in a world, that before could only be imagined. expage.com/piratesmainpage.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 6th Jun 2005 09:03 Edited at: 6th Jun 2005 09:04
Judging by what Baggers is saying (even know I was too lazy to move my mouse over the code button...) (nevermind I just did it yeah) you're looking for wrapvalue...which is what Baggers said...so there really is no reason for me to post this...damn.

Er...PRINGLE JINGLE!

Your signature has been erased by a mod because the filesize was too large.
Colin Hart
21
Years of Service
User Offline
Joined: 28th Apr 2003
Location: United Kingdom
Posted: 6th Jun 2005 20:34
Thank you very much all. The problem has beens solved.... baggers thank you...
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 11th Jun 2005 05:44
How about you add if leftkey()=1 to your code.

______________________________________
<<<<I can program using anything>>>>

Login to post a reply

Server time is: 2024-09-23 21:19:44
Your offset time is: 2024-09-23 21:19:44