I would like to move a sprite across the screen in relation to the input offset the system gives me. I’ve figured out where the sprite should be, but what is a function which will give the desired output, given the input? Here’s the input and output:
0 -> -160
-120 -> -200
-240 -> -240
-360 -> -280
-480 -> -320
0 is the max, -480 the min, and -240 corresponds exactly, but the system will interpolate other input positions. Hence the need for a function with an algorithm to determine the output given the input, and not a lookup table.
This should be pretty easy, but I am stupid.
Try this 🙂
that should do the trick