From 02239bb4d261dbc16581a72486bbfd33fa04be8c Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sun, 19 Jan 2020 02:08:25 -0500 Subject: [PATCH] Fix TransformCx hack that put collision detection rotation and render rotation out of sync. (originally introduced to workaround AI getting the Y axis flipped) --- src/Ecs/Location.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ecs/Location.ts b/src/Ecs/Location.ts index 7e0ef06..2bea3d9 100644 --- a/src/Ecs/Location.ts +++ b/src/Ecs/Location.ts @@ -3,7 +3,7 @@ import { Join } from "./Data"; export function TransformCx(cx: CanvasRenderingContext2D, location: Location, dt = 0) { 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 {