Game Development Community

Exponentiation

by gabriel L.B. · in Torque X 2D · 06/04/2011 (3:11 pm) · 2 replies

hey !

im working on a platformer game and i want to make an acceleration effect to my player ...
so i want to use an Exponentiation to my ''speed''variable ...

im using editPlus and i want to know how can i make Exponentiation ... i tried '' ^ '' and i also tied the '' x '' in exponent form ( like small at the top right )

but it doesnt work .. do u have a clue for me ?? :)


thanks !

About the author

Recent Threads

  • life icon

  • #1
    06/06/2011 (2:46 pm)
    If we're talking about TorqueX/C# you could increase "speed" using += in your process tick

    Here's an example from one of my projects
    // Velocity increases while right trigger is pressed
    Velocity += move.Triggers[1].Value * 0.5f;

    #2
    06/06/2011 (7:02 pm)
    there's an exponant function I've used. I think its:
    mPow( val , power )

    so If I remember you can do 2^7 by

    $powerVar =mPow(2,7)

    there's more info in the documentation here:
    http://tdn.garagegames.com/wiki/TorqueScript_Console_Functions_21