Fix TransformCx hack that put collision detection rotation and render rotation out of sync.

(originally introduced to workaround AI getting the Y axis flipped)
This commit is contained in:
Tangent Wantwight 2020-01-19 02:08:25 -05:00
parent 5fed6ea82f
commit 02239bb4d2

View file

@ -3,7 +3,7 @@ import { Join } from "./Data";
export function TransformCx(cx: CanvasRenderingContext2D, location: Location, dt = 0) { export function TransformCx(cx: CanvasRenderingContext2D, location: Location, dt = 0) {
cx.translate(location.X + location.VX * dt, location.Y + location.VY * dt); cx.translate(location.X + location.VX * dt, location.Y + location.VY * dt);
cx.rotate(-location.Angle + location.VAngle * dt); cx.rotate(location.Angle + location.VAngle * dt);
} }
export function TfPolygon({points}: Polygon, {X, Y, Angle}: Location): Polygon { export function TfPolygon({points}: Polygon, {X, Y, Angle}: Location): Polygon {