How to make smooth curve beam?

Before I start, my first language isn’t english. So if I have issues with grammars or so, please genereously understand.

I’m making 2d java game and having some issues with making beam.
I want to make boss shoot beam to player, but things don’t work smoothly.
I’m okay with making straight beam but I want beam to curve.

First thing I want to ask is about hitbox of curved beam.
I’m using consecutive rectangles for hitbox, is that the right way or is there any other better way to do it?

And actual issue I’m having is with rendering issue, currently I’m using rectangle shaped blocks to draw beam.
First problem is it doesn’t look smooth curve at all, rather it looks well… too rectangled?
Aside from curves not looking smooth, as beams ares slightly transparent, overlapping part of beams are rendered more dark which I don’t want happen.

How can I solve this issues?
#edit is there any tips for rectangle/image ratio of width&height to make curve more smooth?

Could you try using a [icode]Polygon[/icode] instead of consecutive Rectangles?

make beams images and scale/rotate/skew them real time

I tried to do it with polygon at first, but if beam curve in other way I need to set each point to look like right curve shape.
I have no idea how to do that so I changed it to rectangle any tips for setting point?

And I tried to rotate relative to each beam image adjacent to it but it still leave the overlapping problem

Draw the beams to a custom buffer which checks to see if a pixel is set already and then copy that buffer to the screen

i’d use a https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline

advantage over other splines is its constant time property. you can twist alot and still have a continuous animation.

simple line rendering might be good enough