07-04-2024, 06:21 PM
Don't know why you are using _atan2 that is good for finding angle from one point and another so you would use _atan2(y1-y2, x1-x2) for the angle of point x1, y1 to point x2, y2 and vice versa for angle p2 to p1 = _atan2(y2-y1, x2-x1) in radians of course.
I converted back to what I consider normal sin and cos usage, maybe the ship looks better???
I converted back to what I consider normal sin and cos usage, maybe the ship looks better???
Code: (Select All)
For c = 1 To UBound(pnt) ' rotate ship
pnt(c).ang = pnt(c).ang + adder
radians = _D2R(pnt(c).ang)
pnt(c).x = pnt(c).radius * Cos(radians) + shipX ' ???? atan2 subbed for x/cos value spins in Y axis, neg for left side, pos for right
pnt(c).y = pnt(c).radius * Sin(radians) + shipY ' ???? atan2 subbed for y/sin value spins in X axis, upside down, rightside up...
Next c
b = b + ...