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 / 3rd person

Author
Message
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Nov 2003 11:11
How do you get a character object to loop only when you push an arrow key? I've read the tutorials but still don't get it.

Baneblade
22
Years of Service
User Offline
Joined: 26th Feb 2003
Location: Ireland
Posted: 14th Nov 2003 11:45
Something like the below should work
If INKEY$()="w" or Upkey()=1
Loop object 3, walkstart+5,walkend
MOVE OBJECT 3,-0.5
endif
It depends how you setup you animation
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 14th Nov 2003 14:07 Edited at: 14th Nov 2003 14:07
that won't work if you hold down the upkey .

has to be something like:

stage = 0
if upkey() = 1 then stage = 1

if stage <> ostage
if stage = 0:set object speed:loop object
if stage = 1:set object speed:loop object
ostage = stage
endif

then you can expand from there, it's all in the DB help menu.

HIH

Login to post a reply

Server time is: 2025-05-21 16:11:30
Your offset time is: 2025-05-21 16:11:30