import Vector2 from '../math/Vector2.js'; import GameObject from '../core/GameObject.js'; /** * Configuration for creating a Circle object. */ export interface CircleProps { /** Unique tag for identification. */ tag?: string; /** Hidden identifier linking runtime object to its source code location. */ __sourceId?: string; /** Initial position of the circle. */ position: Vector2; /** Radius of the circle. */ radius: number; /** Fill colour. */ colour?: string; /** Render order (lower is background). */ zIndex?: number; /** Whether the circle is initially visible. */ visible?: boolean; /** Initial physics configuration. */ physics?: { velocity?: Vector2; acceleration?: Vector2; mass?: number; isStatic?: boolean; restitution?: number; friction?: number; isSensor?: boolean; }; } /** * A basic circle shape that can be drawn to the screen. */ export default class Circle extends GameObject { /** Radius of the circle in local space. */ radius: number; /** Fill colour (CSS colour string). */ colour: string; /** * The centre point of the circle in world space. */ get centre(): Vector2; /** * The radius of the circle in world space (accounting for scale). */ get worldRadius(): number; /** * initialises a new instance of a Circle. * @param props Configuration properties for the circle. */ constructor(props: CircleProps); }