Skip to content

Releases: straker/kontra

v7.1.0

17 Aug 19:04
Compare
Choose a tag to compare
  • feat(helpers): add getWorldRect
  • fix(gameObject): call custom update function when group is turned off
  • fix(pointer): account for camera
  • fix(pointer): account for border, padding and transform

v7.0.0

11 Aug 17:24
Compare
Choose a tag to compare

Breaking Changes

Sprite

  • When drawing a sprite, the sprite has now been translated to the proper location to start drawing the sprite. You should use 0, 0 to start drawing instead of this.x, this.y.
- this.context.fillRect(this.x, this.y, this.width, this.height);
+ this.context.fillRect(0, 0, this.width, this.height);
  • Removed support for flipping an image using a negative width/height. Use the new setScale to set the scale to a negative value to flip.
  • viewX and viewY removed
  • collidesWith removed. Use the new kontra.collides helper function

keyboard

  • Removed support for KeyboardEvent.keycode as KeyboardEvent.code now works in all major browsers

pointer

  • Removed kontra.pointer. Use the new kontra.getPoiner.

Vector

  • add no longer accepts the dt parameters. Use the new Vector.scale function to scale a vector.

Features

Assets

  • Support for .wav files

Button

Button is a new component which allows you to create accessible Buttons for your game.

GameLoop

  • pass canvas to change which canvas is cleared.

GameObject

GameObject is a new parent class for Sprite and handles most rendering functionality. You should continue to use Sprite as you do today. New features include:

  • opacity support
  • scaleX, scaleY, and setScale for scale support
  • world for getting the world position, size, opacity, scale, and rotation
  • children, parent, addChild, and removeChild for grouping support

Grid

Grid is a new component which helps you easily create UI menus by auto-placing objects into a grid.

Helpers

A group of helpful functions.

  • kontra.degToRad
  • kontra.radToDeg
  • kontra.angleToTarget
  • kontra.rotatePoint
  • kontra.randInt
  • kontra.seedRand
  • kontra.lerp
  • kontra.inverseLerp
  • kontra.clamp
  • kontra.setStoreItem
  • kontra.getStoreItem
  • kontra.collides

pointer

  • kontra.initPointer returns the pointer object
  • can now work with multiple canvases by passing the canvas to initPointer and getPointer

Scene

Scene is a new component to organize the differnet parts of your game

Text

Text is a new component to write text to the canvas

Vector

  • Vector​.angle
  • Vector​.clamp
  • Vector​.distance
  • Vector​.dot
  • Vector​.length​
  • Vector​.normalize
  • Vector​.scale
  • Vector​.subtract

v6.9.1

10 Dec 20:35
Compare
Choose a tag to compare

fix(tileEngine): don't error for object layers @andre-lima

v6.9.0

22 Oct 03:29
Compare
Choose a tag to compare
  • feat(pointer): add multi-touch support @crhallberg
  • fix(tileEngine): rerender individual dirty layers @FabricioK

v6.8.0

12 Oct 13:43
Compare
Choose a tag to compare

feat(tileEngine): make tileEngine.renderLayer re-render when dirty

v6.7.1

03 Oct 02:46
Compare
Choose a tag to compare

fix(pool): improved pool performance @crhallberg

v6.7.0

02 Oct 01:32
Compare
Choose a tag to compare

feat(keyboard): fix keyboard input for non-US keyboards @depp

v6.6.0

16 Sep 03:59
Compare
Choose a tag to compare
  • chore: fix typo in file name @Rayne
  • chore: add esversion to .jshintrc @Rayne
  • feat(tileEngine): Add setLayer to TileEngine @Tollefsen

v6.5.0

05 Sep 06:03
Compare
Choose a tag to compare

feat(sprite): support negative width/height to flip sprite

v6.4.1

02 Sep 19:01
Compare
Choose a tag to compare

fix(tileEngine): fix Safari not drawing when canvas is larger than image @sdepold