Assigning "solid()" to a circle() object in addLevel throws "Error: failed to get area dimension"
Version
v2000.2
What browsers are you seeing the problem on?
Chrome
What happened?
If I try to produce a solid circle in a addLevel config, it gives me an error.
Error: failed to get area dimension
The behaviour starts when I assign solid() in the level config to the object. If I switch circle() to a rect() everything works like expected.
But I badly want that solid circle :)
See the code example below...
What's the expected behavior?
Applying "solid()" to a circle object should not result in an error. Instead it should produce a solid circle in the map that we can collide against like hell :)
Minimum reproducable code
Inside an addLevel call:
"e": () => [
"enemy",
circle(10),
area(),
solid(),
color(255,0,0)
]
Gives:
Error: failed to get area dimension
If I use a rect() instead of circle() in the example above, everything works fine!
So it is clearly the combination of "circle" and "solid".
Live demo
No response
Alright, I realized that I need to configure the area with concrete values for width & height to eliminate the issue.
But it would be nicer, if either the docs get updated for the "circle()" function here OR to take the circle radius * 2 as default for width & height of the area, in case we apply area() on a circle object. Then the code will not break unexpectedly.
Yeah circle doesn't have automatic area in this version, but will do in the upcoming version
Already fixed for v3000.