How to create arbitrary shapes?

I have checked Shape, some of the classes that implements Shape, General path, PathIterator, Area. But I still don’t know how far java can reach in drawing shapes.

May I create vector diagram? May I define a shape using mathematical functions? Something like that. It would be best if there is a game totally drawn by code rather than importing images.

I think it’s a pretty cool idea, too. Check this “Vector Shooter” out :wink: (Only look at the videos and the idea. The code itself is for the jMonkeyEngine).

What do you mean by Vector Diagram?

In the end, Java2D is pretty strong when it comes to drawing shapes. As far as I know, it’s even possible to draw concave shapes, which needs additional triangulation in case it’s not rendered in software :slight_smile:

I would also suggest to use something else than Java2D, because it’s API is not really made for games and it can be really slow in some cases. You could try out LibGDX, and if you do, try out it’s “ShapeRenderer”.