So here's my dilemma. I'm making a game that involves controlling a bar. One set of keys, WASD I guess, will move one end of the stick. The other set, arrow keys or numpad, will control the other. The goal is so that I am controlling a bar, like a stiff iron rod, where I control the movement the two ends separately.
That might be hard to picture so here's an example.
[L]------[R] <-- bar, with two ends.
If I press W, that makes the left side of the bar go up. So then it should look something like this
. . . . [L]
. . . . .|
. . . . .|
. . . . [R]
And after that, if I press left arrow and down arrow, the right side moves in that direction. Like this
. . . [L]
. . ./
Problem number one is getting the line to stay rigid. If I used a Line object, then it'll stretch and stuff and I have no idea how I could get it to stay a certain length and still be able to control it the way I want. Problem number two is that the bar rotates on each end the right way. So if I only move one end, the other end stays still, like it's just moving in a circle. I only want the bar to move completely if I move both ends at the same time. This also means that if I do complex motions like, move the left end upwards and the right end to the side, it still works right.
You can get an idea of what I'm doing by putting a line between two sprites with 8Direction movement and just, move them. The only thing I want different is for the two sprites to always be the same distance from eachother.
So if anyone has any ideas to help me with this, I'd greatly appreciate it.