CircleCollider

The circle collider 2D circle that is used for collision detection. The collider positions itself based on the entity's Transform position.

Properties:

PropertyTypeFunctionality
radiusfloatThe radius of the circle collider.
offsetvec2An offset of the origin. The origin is based on the Transform position [x, y].
bCollidingboolA flag used to inform if the collider is touching another collider.

Use Example:

-- Create a new entity, if not already created.
local entity = Entity("tag", "group")

-- Add a new transform component at position [50, 50], scale of 1 and no rotation. 
local circleCollider = entity:add_component(
	CicleCollider(
		16,			-- radius
		vec2(0, 0)		-- offset
	)
)