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 / KeyPress Animation

Author
Message
x_THOR_x
19
Years of Service
User Offline
Joined: 26th Feb 2007
Location:
Posted: 27th Jul 2010 06:34
I have a door that is Animated. When the user presses the R key I need the door to play through frames 1-30, if the user keeps the R key pressed the door stays open but if the user releases the R key I need the frames to go backwards (whatever number they release it at back to 1) the door closes.

I am having trouble with the release part. Any help please?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 27th Jul 2010 13:04 Edited at: 27th Jul 2010 13:05
You could do something like:
Imagine your door is animated with 30 frames to open

If inkey$()="r" then frame=frame+1 else frame=frame-1
if frame<0 then frame=0
if frame>30 then frame=30
play object door,frame

I hope it can help

cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-25 05:32:51
Your offset time is: 2026-07-25 05:32:51