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 / HELP!: How can I use Curveangle with JOYSTICK

Author
Message
Max Maker
19
Years of Service
User Offline
Joined: 17th May 2007
Location: 4
Posted: 18th Aug 2010 23:16
Hi all.
I'm using curveangle with keyboard it works

look at the example



But I need using this code for joystick (analog)

Note: there is Glitch ! when you press both of right key and down key

please help. & thanks

4444444444444444444444
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th Aug 2010 23:50
Not sure what sort of movement type you are after. Here is your code amended a little.

You can change the speed variable to alter the rotation speed.

http://s6.bitefight.org/c.php?uid=103081
Max Maker
19
Years of Service
User Offline
Joined: 17th May 2007
Location: 4
Posted: 19th Aug 2010 00:00 Edited at: 19th Aug 2010 00:02
Mr.DVader

not that i'm talking about

Try this


4444444444444444444444
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Aug 2010 00:57
It might be better to work out the angle of the analogue stick, like using joystick x() and joystick y()...

Ang#=curveangle(atanfull(joystick x(),joystick y()),Ang#,4.0)

Perhaps it would also be an idea to use the distance to work out the curve speed, so the smaller the movement, the lower the speed...


Something like that maybe, haven't tested it as I don't have a joystick plugged in.

Health, Ammo, and bacon and eggs!
Max Maker
19
Years of Service
User Offline
Joined: 17th May 2007
Location: 4
Posted: 19th Aug 2010 02:02
thanks Mr.Van B
you really help me. thanks

4444444444444444444444

Login to post a reply

Server time is: 2026-07-25 02:46:48
Your offset time is: 2026-07-25 02:46:48