Thanks to @DavidLi119, @radist2s, @magnusandy, @djcsdy, and @ZuzuZain for their contributions!
Breaking Changes
ex.Actor.scale
,ex.Actor.sx/sy
,ex.Actor.actions.scaleTo/scaleBy
will not work as expected with new collider implementation, set width and height directly. These features will be completely removed in v0.24.0.
Added
- Add new collision group implementation (#1091, #862)
- New
ex.Collider
type which is the container for all collision related behavior and state. Actor is now extracted from collision. - Added interface
Clonable<T>
to indicate if an object contains a clone method - Added interface
Eventable<T>
to indicated if an object can emit and receive events ex.Vector.scale
now also works with vector inputex.BoundingBox.fromDimension(width: number, height: number)
can generate a bounding box from a width and heightex.BoundingBox.translate(pos: Vector)
will create a new bounding box shifted bypos
ex.BoundingBox.scale(scale: Vector)
will create a new bounding box scaled byscale
- Added
isActor()
andisCollider()
type guards - Added
ex.CollisionShape.draw
collision shapes can now be drawn, actor's will use these shapes if no other drawing is specified - Added a
getClosestLineBetween
method toCollisionShape
's for returning the closest line between 2 shapes (#1071)
Changed
-
Change
ex.Actor.within
to use surface of object geometry instead of the center to make judgements (#1071) -
Changed
moveBy
,rotateBy
, andscaleBy
to operate relative to the current actor position at a speed, instead of moving to an absolute by a certain time. -
Changed event handlers in excalibur to expect non-null event objects, before
hander: (event?: GameEvent) => void
implied that event could be null. This change addresses (#1147) making strict null/function checks compatible with new typescript. -
Changed collision system to remove actor coupling, in addition
ex.Collider
is a new type that encapsulates all collision behavior. Useex.Actor.body.collider
to interact with collisions in Excalibur (#1119)- Add new
ex.Collider
type that is the housing for all collision related code- The source of truth for
ex.CollisionType
is now on collider, with a convenience getter on actor - The collision system now operates on
ex.Collider
's notex.Actor
's
- The source of truth for
ex.CollisionType
has been moved to a separate file outside ofActor
- CollisionType is switched to a string enum, style guide also updated
ex.CollisionPair
now operates on a pair ofex.Colliders
's instead ofex.Actors
'sex.CollisionContact
now operates on a pair ofex.Collider
's instead ofex.Actors
'sex.Body
has been modified to house all the physical position/transform information- Integration has been moved from actor to
Body
as a physical concern useBoxCollision
has been renamed touseBoxCollider
useCircleCollision
has been renamed touseCircleCollider
usePolygonCollision
has been renamed tousePolygonCollider
useEdgeCollision
has been renamed touseEdgeCollider
- Integration has been moved from actor to
- Renamed
ex.CollisionArea
toex.CollisionShape
ex.CircleArea
has been renamed toex.Circle
ex.PolygonArea
has been renamed toex.ConvexPolygon
ex.EdgeArea
has been renamed toex.Edge
- Renamed
getWidth()
&setWidth()
to propertywidth
- Actor and BoundingBox are affected
- Renamed
getHeight()
&setHeight()
to propertyheight
- Actor and BoundingBox are affected
- Renamed
getCenter()
to the propertycenter
- Actor, BoundingBox, and Cell are affected
- Renamed
getBounds()
to the propertybounds
- Actor, Collider, and Shapes are affected
- Renamed
getRelativeBounds()
to the propertylocalBounds
- Actor, Collider, and Shapes are affected
- Renamed
moi()
to the propertyinertia
standing for moment of inertia - Renamed
restition
to the propertybounciness
- Moved
collisionType
toActor.body.collider.type
- Moved
Actor.integrate
toActor.body.integrate
- Add new
Deprecated
-
Legacy groups
ex.Group
will be removed in v0.24.0, use collision groups as a replacement (#1091) -
Legacy collision groups off
Actor
will be removed in v0.24.0, useActor.body.collider.collisionGroup
(#1091) -
Removed
NaiveCollisionBroadphase
as it was no longer used -
Renamed methods and properties will be available until
v0.24.0
-
Deprecated collision attributes on actor, use
Actor.body.collider
Actor.x
&Actor.y
will be removed inv0.24.0
useActor.pos.x
&Actor.pos.y
Actor.collisionArea
will be removed inv0.24.0
useActor.body.collider.shape
Actor.getLeft()
,Actor.getRight()
,Actor.getTop()
, andActor.getBottom
are deprecated- Use
Actor.body.collider.bounds.(left|right|top|bottom)
- Use
Actor.getGeometry()
andActor.getRelativeGeometry()
are removed, useCollider
- Collision related properties on Actor moved to
Collider
, useActor.body.collider
Actor.torque
Actor.mass
Actor.moi
Actor.friction
Actor.restition
- Collision related methods on Actor moved to
Collider
, useActor.body.collider
orActor.body.collider.bounds
Actor.getSideFromIntersect(intersect)
->BoundingBox.sideFromIntersection
Actor.collidesWithSide(actor)
->Actor.body.collider.bounds.intersectWithSide
Actor.collides(actor)
->Actor.body.collider.bounds.intersect
Fixed
- Fixed issue where leaking window/document handlers was possible when calling
ex.Engine.stop()
andex.Engine.start()
. (#1063) - Fixed wrong
Camera
andLoader
scaling on HiDPI screens when optionsuppressHiDPIScaling
is set. (#1120) - Fixed polyfill application by exporting a
polyfill()
function that can be called. (#1132) - Fixed
Color.lighten()
(#1084)