Collision.CollisionBox Class
The CollisionBox class allow you to declare a bounding box to test collisions between other collisions boxes and collisions circles.
Constructor
Collision.CollisionBox
-
x
-
y
-
w
-
h
Parameters:
-
x
Numberthe x coordinate of the collision box
-
y
Numberthe y coordinate of the collision box
-
w
Numberthe width of the collision box
-
h
Numberthe height of the collision box
Item Index
Methods
isCollidingBox
-
box
The isCollidingBox method allow you to test if the current CollisionBox object is colliding the CollisionBox object given in parameter.
Parameters:
-
box
CollisionBoxthe CollisionBox object to test the collision with
Returns:
isCollidingCircle
-
circle
The isCollidingCircle method allow you to test if the current CollisionBox is colliding the CollisionCircle object.
Parameters:
-
circle
CollisionCirclethe CollisionCircle object to test the collision with.
Returns:
isPointInside
-
px
-
py
The isPointInside method allow you to test if a point is inside the bouncing box.
Parameters:
-
px
Numberthe x coordinate of the point
-
py
Numberthe y coordinate of the point
Returns:
isSegmentCollidingCircle
-
ax
-
ay
-
bx
-
by
-
circle
The isSegmentCollidingCircle method allow you to test if a segment is colliding a circle
Parameters:
-
ax
Numberthe x coordinate of the first point of the segment
-
ay
Numberthe y coordinate of the first point of the segment
-
bx
Numberthe x coordinate of the second point of the segment
-
by
Numberthe y coordinate of the second point of the segment
-
circle
CollisionCirclethe CollisionCircle object to test collision with the segment
Returns:
Properties
height
Number
type
String
type of Collision object