excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.82k stars 189 forks source link

Bug: Infinite loading loop when adding an Actor with both non-zero rotation and a PolygonCollider without Vector points #3205

Closed Autsider666 closed 1 month ago

Autsider666 commented 2 months ago

Steps to Reproduce

Create an Actor with rotation and a PolygonCollider without Vector points.

const engine = new Engine();
engine.start();

const actor = new Actor({
    rotation: 0.1,
    collider: Shape.Polygon([]),
});
engine.add(actor);

Expected Result

Either nothing or an error.

Actual Result

Page gets stuck in infinite loading loop.

Environment

Current Workaround

Not making the mistake of accidentally creating a PolygonCollider without points :P

eonarheim commented 2 months ago

@Autsider666 good find! Definitely a bug!