Skip to content

v0.10.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@jthomperoo jthomperoo released this 25 Feb 00:38
· 1 commit to master since this release
ffaf409

[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 to Vector
    • New -> provisions a Vector from the object pool if available, if not it creates a new instance.
    • Free -> releases a Vector back into the object pool if available.
    • Init -> initializes the Vector object pool to a specified size.
  • Renderable object is now poolable, with similar helper static functions as Vector.
  • DispatchUntilEmpty method added to MessageBus, 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, and EllipseEstimation 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 implements IFreeable, allowing component values to be freed upon removal/entity destruction. This
    must be implemented on a per Component 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 method FarthestPointInDirection faster and using less Vector objects.
  • Pointer, pointer move, and wheel events synced up and dispatched within the engine update loop.
  • Polygon uses Float32Array internally.
  • Polygon can now be initialised with a Float32Array.
  • 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 a StatefulSystem.