rectangle

fun rectangle(x: Float, y: Float, width: Float, height: Float): Hitbox2D

Creates a rectangular hitbox given its position and size.

Return

A Hitbox2D representing the rectangle.

Parameters

x

The x coordinate of the top-left corner.

y

The y coordinate of the top-left corner.

width

The width of the rectangle.

height

The height of the rectangle.


fun rectangle(x: Int, y: Int, width: Int, height: Int): Hitbox2D

Creates a rectangular hitbox given its position and size using integer parameters.

Return

A Hitbox2D representing the rectangle.

Parameters

x

The x coordinate of the top-left corner.

y

The y coordinate of the top-left corner.

width

The width of the rectangle.

height

The height of the rectangle.