Open a-a-GiTHuB-a-a opened 2 years ago
The code for version 2000.2.9 shows that Shape is a union of strings
https://github.com/replit/kaboom/blob/v2000.2.9/src/types.ts#L3815
But the area()
function always returns a rect
. https://github.com/replit/kaboom/blob/v2000.2.9/src/kaboom.ts#L3651
Yes, only rectangular collisions work in the version 2000.2.9. But as you mentioned in the original post, it's different in master. I imagine it will work very differently in the next release, and for the current release the only potential fix would be to remove other shapes from the documentation.
Version
2000.2.9
What browsers are you seeing the problem on?
Microsoft Edge
What happened?
The documentation states that the Shape type is a union of strings. However, the code says it is a union of classes. On a related note, using a
Circle
orPolygon
for theshape
option ofarea()
does not do anything.What's the expected behavior?
The documentation should reflect the type, and
area()
should supportshape
.Minimum reproducable code
Live demo
No response