J
Jeshuakrc
Guest
Hey there! I'm doing a camera muvement based on the mouse position according to the border of the camera, so, I what to make it so that while more close the mouse is to an edge of the camera, it move faster. But over the game, the point the mouse has to reach to de camera starts moving ("camera_border" as I called it) and the camera's max speed will change through levels, so I can´t use just an equation, I need someone that changes according the camera_border an de max speed. I first achieved it, but with a linear function (y=mx+b), I works well, but I want an exponential function, where the transition between show and realy fast be smooth. So I need a funtión like that: y=a*b(x), where x is the mouse position from the center of the sceen, and have to calculate a and b based on the points (camera_border,0) and (view_wview[0]/2,max_speed).
I'm not so good at algebra, and have been a whole afternoon trying to figure it out, and finaly deciced to find help here.
I'm not so good at algebra, and have been a whole afternoon trying to figure it out, and finaly deciced to find help here.