3.0.0
Release Notes
- docs: add github-pages doc directory
- refactor: greatly reduce file size of all files and remove a lot of public properties and functions
- refactor: changed examples to work with new code
- feat(assets): add assets.js from straker/kontra-asset-loader
- feat(spriteSheet): add margin property for images with margins between frames
Deprecations
In order to reduce the library to as small as possible, many features were removed. Most were unpublished public properties or functions that moved to private implementations to improve minification, but others were not.
Please note the following public properties and functions that have been removed.
Assets
Removed asset bundles and asset manifest from straker/kontra-asset-loader.
In 2.x, all Asset properties and functions were added to the Kontra object directly. This is no longer the case and now all Asset properties and functions have been put under their own namespace kontra.assets
. As such, most of the names were changed to reflect the move.
kontra.canUse
kontra.assetPaths
was removed and subproperties were renamed tokontra.assets.imagePath
,kontra.assets.audiopath
andkontra.assets.dataPath
kontra.audios
was renamedkontra.assets.audio
kontra.getAssetExtension()
kontra.getAssetType()
kontra.getAssetName()
kontra.loadAssets()
was renamedkontra.assets.load()
and should be used instead of the load functions for images, audio, and data.kontra.loadImage()
kontra.loadAudio()
kontra.loadData()
kontra.bundles
kontra.createBundle()
kontra.loadBundles()
kontra.loadManifest()
Core
kontra.logError()
kontra.noop()
kontra.isString()
kontra.isNumber()
kontra.isImage()
kontra.isCanvas()
kontra.game
Game loop
kontra.timestamp
Keyboard
- The ability to bind to combination keys (
ctrl+c
, etc.) has been removed
Pool
kontra.pool.createProperties
argumentkontra.pool.fill
argumentkontra.pool.lastIndex
kontra.pool.inUse
Quadtree
kontra.quadtree.depth
kontra.quadtree.isBranchNode
kontra.quadtree.parentNode
kontra.quadtree.render()
kontra.quadtree.init()
Sprite
kontra.sprite.timeToLive
was renamedkontra.sprite.ttl
Sprite sheet animation
kontra.animation.currentFrame
kontra.animation.stop()
kontra.animation.pause()
kontra.animation.play()
kontra.animation.init()
Spritesheet
kontra.spriteSheet.init()
Store
kontra.store.remove()
kontra.store.clear()
Tile engine
kontra.tileEngine.canvasWidth
kontra.tileEngine.canvasHeight
Vector
kontra.vector()
once again takesx,y
arguments instead of an object withx,y
properties. This matches almost all other implementations of Vectors I could find (http://victorjs.org/, https://gist.github.com/winduptoy/a1aa09c3499e09edbd33, https://gist.github.com/jjgrainger/808640fcb5764cf92c3cad960682c677)