v0.10.0
Pre-release
Pre-release
[v0.10.0] - 2021-02-25
Added
CanvasResizeSystem
to handle automatic resizing of the canvas to fit a wrapper/the screen while maintaining the
requested aspect ratio and within maximum resolution constraints.CanvasResize
utility functions to allow manual canvas resizing and providing best estimate aspect ratios.- Global variables to allow flexiblity in hosting environment.
window.JamJar.CanvasID
- The ID of the canvas to render to.window.JamJar.CanvasWrapperID
- The ID of the wrapper around the canvas, used to handle automatic resizes.window.JamJar.RootPath
- The 'root path' that the game was loaded from to handle resolving paths to assets.
- Ability to stop games, using the
window.JamJar.StopGames()
global function, allows host sites to stop a running
game. - Object pooling, allows reusing objects in memory to avoid the garbage collection churn of create -> delete -> create.
This can help prevent stuttering due to minor and major garbage collection occurring between frames by reducing the
volume of objects that need garbage collected. Vector
object is now poolable, with helper static functions added toVector
New
-> provisions aVector
from the object pool if available, if not it creates a new instance.Free
-> releases aVector
back into the object pool if available.Init
-> initializes theVector
object pool to a specified size.
Renderable
object is now poolable, with similar helper static functions asVector
.DispatchUntilEmpty
method added toMessageBus
, allows repeated dispatching until the message queue is empty.StatefulSystem
abstract definition for tracking entities and components, handles listening for registration and
deregistration.ArraySystem
for tracking entities and components in an array, good for iteration.MapSystem
for tracking entities and components in a map, good for lookups.
Changed
- In
Polygon
->RectangleByDimensions
,QuadByDimensions
, andEllipseEstimation
all now represent center/origin
using two X and Y numbers rather than a vector object to avoid unneeded object creation. - In
Ellipse
->Circle
represnts center using two X and Y numbers rather than a vector object to avoid unneeded
object creation. Component
implementsIFreeable
, allowing component values to be freed upon removal/entity destruction. This
must be implemented on a perComponent
basis by overriding this function.- The game loop now ensures all game logic messages are processed using
DispatchUntilEmpty
before executing any
render logic. AABBAlgorithm
more efficient algorithm involving sweeping horizontal then vertical.AABB
methodFarthestPointInDirection
faster and using lessVector
objects.- Pointer, pointer move, and wheel events synced up and dispatched within the engine update loop.
Polygon
usesFloat32Array
internally.Polygon
can now be initialised with aFloat32Array
.- Frustum culling moved to preprocessing and removed from render pipeline.
- Replaced in-house Vector and Matrix code with the
gl-matrix
library. - Shapes'
Transform
method is now mutable, it affects the object it is being applied to. Message
objects are now poolable.Color
now internally uses a typed array.System
now stateless, does not track any entities/components, instead use aStatefulSystem
.