I already have the aiming down, But I want to know I could have a line that connects two targets together and rotates as they move. [Yes with pixel movement].
Unfortunately, BYOND, unlike other languages/engines, does not have good support for icon manipulation/rotation and line-drawing. Thus, this is far more complex than it needs to be.
A basic way to do this would be to create an icon of a link in a chain and rotate it to the interval you need (or, possibly, generate the rotations at runtime as you need them and just cache them). Then you calculate the line you must draw at, and the distance between the two objects (divided by the size of the links of the chain). The most computationally-intensive part of this would be rotating the icons*, but you would not have to create new objects at runtime, because the maximum distance is just the distance already there.
Additionally, when either end of the chain moves, the angle would have to be recalculated, and each link in the chain drawn at a new position. You can calculate this as just a rotation around a single point (treating the non-moving body as the origin). This ends up being pretty simple, and can be calculated as the following matrix:
where T is the angle, (x0, y0) is the point being rotated around, (x,y) is the point being rotated, and (x',y') is the result.
*Note that, if you don't want to stick as strongly to the chain, or go for graphical realism, you could have a simple round shape with some detail that does not rotate.
You know Scorpion's get over here move? Thats what I want, which would be hard to imiatate Unless I can crop from the top, which I can of course. Thanks.
No reason your right lmfao.
Actually because of the rotation I don't know where I should crop.
Well, once again you would use trigonometry, depending on how you do it. If you crop and then rotate, you crop at the distance they're at. If you rotate and then crop, you use trig to figure out the x and y values, and then crop there.
*Edit*
For clarification using Icon.New() and Icon.Crop() on a dmi that is 150KB uses too much processing power to be used in something that updates more than once a second. :-\.
A basic way to do this would be to create an icon of a link in a chain and rotate it to the interval you need (or, possibly, generate the rotations at runtime as you need them and just cache them). Then you calculate the line you must draw at, and the distance between the two objects (divided by the size of the links of the chain). The most computationally-intensive part of this would be rotating the icons*, but you would not have to create new objects at runtime, because the maximum distance is just the distance already there.
Additionally, when either end of the chain moves, the angle would have to be recalculated, and each link in the chain drawn at a new position. You can calculate this as just a rotation around a single point (treating the non-moving body as the origin). This ends up being pretty simple, and can be calculated as the following matrix:
[cosT -sinT] [x0 - x] + [x0] = [x']
[sinT cosT] [y0 - y] + [y0] = [y']
where T is the angle, (x0, y0) is the point being rotated around, (x,y) is the point being rotated, and (x',y') is the result.
*Note that, if you don't want to stick as strongly to the chain, or go for graphical realism, you could have a simple round shape with some detail that does not rotate.