I am having a problem when I try to put easing inside of a function that would draw lines. Essentially, I wrote a function where you give the coordinates of 2 line segments and when the mouse is all the way left it is the first line, and as you move the mouse right, it moves to the position of the second. I got that part of the code working, but when I added easing to the mix, everything went wacky. Here is my code:
When x1, y1, x2, and y2 are declared outside of the function, the lines are in seemingly random positions near the area they should be. When they are declared inside the function, it says x1 has not been initialized BUT if I say float x1=0; (like I have shown above) it puts the lines in the right position, just about 100 times smaller then it should be....