# Math question

0 favourites
• 5 posts
From the Asset Store
Aliens are invading our planet! Solve the math question, and attack the alien with your laser. Covers addition, subtract
• Is there a mathematical way to convert Gamepad Analog Stick Sensitivity using a math equation?

The Analog Stick X axis returns (-100 to 0 to 100), this control spins the angle of my player. However I've noticed -as a player- that its hard to make fine-tune adjustments.

So ideally I'd like to make it an exponential curve instead of a linear line. So I'd like 1-75 have less of an effect, and when the player goes to extreme left/right its the full 100. This is mainly to help aiming and to give the controls a more "touch" friendly feel.

Currently my code is:

Rotate max(1,(Gamepad.Axis(0,0) * Player.pTurnRate) * dt) clockwise

and Left

Rotate max(1,(abs(Gamepad.Axis(0,0)) * Player.pTurnRate) * dt) counter-clockwise

Sorry, I've always struggled with maths, I can usually understand it, if explained, but not great at coming up with the solution without help.

Any help would be greatly appreciated! tia

#### Tagged:

• You can use quarp or cubic expressions, see this demo:

dropbox.com/s/bw3d7etlnd3rbp6/QarpCubicRotation.c3p

• dop2000 I think that will work. It feels a lot nicer for smaller angle corrections. you are the best!

do you know if using the cubic expr every tick (for input) would cause any performance issues? I know sqrt() is a high performance function people have mentioned in the past.

• It only becomes a problem if you are using it thousands of times per tick. Once should be absolutely fine.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• dop2000 thanks! this helps a lot!

• 5 posts