import Vector2 from '../math/Vector2.js'; import GameObject from '../core/GameObject.js'; /** * Configuration for creating a Rectangle object. */ export interface RectProps { /** Unique tag for identification. */ tag?: string; /** Hidden identifier linking runtime object to its source code location. */ __sourceId?: string; /** Initial position of the top-left corner. */ position: Vector2; /** Width of the rectangle. */ width: number; /** Height of the rectangle. */ height: number; /** Fill colour. */ colour?: string; /** Render order. */ zIndex?: number; /** Whether the rectangle 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 rectangle shape that can be drawn to the screen. */ export default class Rectangle extends GameObject { /** Fill colour (CSS colour string). */ colour: string; /** * initialises a new instance of a Rectangle. * @param props Configuration properties for the rectangle. */ constructor(props: RectProps); }