All Versions
25
Latest Version
Avg Release Cycle
-
Latest Release
-
Changelog History
Page 1
Changelog History
Page 1
-
v3000.0.0 Changes
Game Objects
- ➕ added scene graph, game objects are now stored in a tree-like structure and can have children with
obj.add()
const bean = add([ sprite("bean"), pos(160, 120), ]) const sword = bean.add([ sprite("sword"), // transforms will be relative to parent bean object pos(20, 20), rotate(20), ]) const hat = bean.add([ sprite("hat"), // transforms will be relative to parent bean object pos(0, -10), ]) // children will be moved alongside the parent bean.moveBy(100, 200) // children will be destroyed alongside the parent bean.destroy()
- ➕ added
GameObj#getAll()
for recursively getting children game objects (get()
only gets from direct children) - ⚡️ changed object update order from reversed to not reversed
- (BREAK) removed
GameObj#every()
andGameObj#revery()
in favor ofobj.get().forEach()
- (BREAK) renamed
GameObj#_id
toGameObj#id
- (BREAK)
addLevel()
now returns aGameObj
which has all individual grid objects as its children game objects, withLevelComp
containing its previous methods
Components
- ➕ added collision support for rotate shapes and polygons
- ➕ added
Area#onCollideUpdate()
andArea#onCollideEnd()
events - ➕ added
Area#onHover()
andonHover()
to register an event that runs once when an object(s) is hovered - ➕ added
Area#onHoverEnd()
andonHoverEnd()
to register an event that runs once when an object(s) stopped being hovered - (BREAK) renamed
onHover()
toonHoverUpdate()
(it registers an event that runs every frame when an object is hovered) - ➕ added
Body#onFall()
which fires when object starts falling - ➕ added
Body#onPhysicsResolve()
andBody#onBeforePhysicsResolve()
to register events relating to collision resolution - ➕ added
body({ stickToPlatform: false })
option to turn off object moving with platform - ➕ added
doubleJump()
component to enable double jump - (BREAK) removed
Body#doubleJump()
in favor ofdoubleJump()
component - (BREAK) renamed
Body#weight
toBody#gravityScale
- (BREAK) renamed
Body#onFall()
toBody#onFallOff()
which triggers when object fall off a platform - (BREAK) removed
solid()
in favor ofbody({ isStatic: true })
- (BREAK) defining
gravity()
is now required for enabling gravity,body()
by default will only prevent objects from going through each other - (BREAK) renamed
origin()
toanchor()
, so it won't mess up typescript in global context - (BREAK)
anchor
(previouslyorigin
) no longer controls text alignment, usealign
option instead - (BREAK) changed
outview()
tooffscreen()
, and uses a much more performant check for if object is offscreen- removed
offset
option in favor of a simplerdistance
option - renamed
onExitView()
andonEnterView()
toonExitScreen()
andonEnterScreen()
- removed
- (BREAK) removed
cleanup()
component in favor ofoffscreen({ destroy: true })
- ➕ added
OpacityComp#fadeOut()
- ➕ added
fadeIn()
component stay()
now accepts a list of scenes to stay for, likestay(["gameover", "menu"])
🍱 Assets
- ➕ added
loadProgress()
that returns a0.0 - 1.0
that indicates current asset loading progress - ➕ added
onLoadUpdate()
to register a custom loading screen (see "loader" example)
Font
- ➕ added
loadFont()
to load.ttf
,.otf
,.woff2
or any font supported by browserFontFace
- (BREAK) renamed previous
loadFont()
toloadBitmapFont()
- (BREAK) removed built-in
apl386
,apl386o
,sink
,sinko
(still available underexamples/fonts
) - ➕ added default font
happy
- 🔄 changed default font size to
36
Drawing
- 🛠 fixed visual artifacts on text rendering
- ➕ added
colors
option todrawPolygon()
that controls the color of each corner - ➕ added
gradient
option todrawRect()
that specifies the start and end color - ➕ added option
loadingScreen
tokaboom()
where you can turn off the default loading screen - ➕ added
drawMasked()
anddrawSubtracted()
- ➕ added
pushRotateX()
,pushRotateY()
andpushRotateZ()
- ➕ added
pixelDensity
option tokaboom()
- 🔊 shader error logs now yields the correct line number
Input
- ➕ added virtual controls for mobile, enabled with
virtualControls: true
inkaboom()
- ➕ added
isVirtualButtonPressed()
,isVirtualButtonDown()
,isVirtualButtonReleased()
- ➕ added
onVirtualButtonPress()
,onVirtualButtonDown()
,onVirtualButtonRelease()
- 🛠 fixed touches not treated as mouse
- (BREAK) changed
onTouchStart()
,onTouchMove()
andonTouchEnd()
callback signature to(pos: Vec2, touch: Touch) => void
(exposes the nativeTouch
object)
Misc
- (BREAK) removed all deprecated functions in v2000.2
- (BREAK) raised esbuild target to
esnext
- 🚚 moved type defs for global functions to
import "kaboom/global"
// if use global functions import "kaboom" import "kaboom/global" // required to load global types kaboom() // will have definition add() // if don't use global function import "kaboom" kaboom({ global: false }) // type error, won't pollute global namespace if not manually import "kaboom/global" add()
- ➕ added
tween()
for tweening, and a set of built-in easing functions ineasings
onMousePress(() => { tween(bean.pos.x, mousePos().x, 1, (val) => bean.pos.x = val, easings.easeOutBounce) tween(bean.pos.y, mousePos().y, 1, (val) => bean.pos.y = val, easings.easeOutBounce) })
- (BREAK) changed all event handlers to return a
EventController
object instead of a function to cancel event - ➕ added
Event
andEventHandler
// previous const cancel = onUpdate(() => { /* ... */ }) cancel() // now, can do more stuff const ev = onUpdate(() => { /* ... */ }) ev.paused = true ev.cancel()
- timers can now be paused
const timer = wait(4, () => { /* ... */ }) timer.paused = true timer.resume() const timer = loop(1, () => { /* ... */ }) timer.paused = true timer.resume()
kaboom()
now automatically focuses the canvas- ➕ added
quit()
to end everything - ➕ added
download()
,downloadText()
,downloadJSON()
,downloadBlob()
- ➕ added
Recording#stop()
to stop the recording and returns the video data as mp4 Blob - ➕ added
debug.numFrames()
to get the total number of frames elapsed - ➕ added
onError()
to handle error or even custom error screen - ➕ added
onResize()
to register an event that runs when canvas resizes - (BREAK) renamed
cursor()
tosetCursor()
- (BREAK) renamed
fullscreen()
tosetFullscreen()
- (BREAK) renamed
isTouch()
toisTouchScreen()
- (BREAK) removed
layers()
in favor of parent game objects (see "layers" example) - (BREAK) removed
load()
event for components, useonLoad()
inadd()
event - (BREAK) removed
debug.objCount()
in favor ofgetAll().length
- ➕ added
debug.numFrames()
to get the current frame count
- ➕ added scene graph, game objects are now stored in a tree-like structure and can have children with
-
v2001.0.0 Changes
- brought back
loadMark()
- (BREAK) removed all deprecated functions in v2000.2
- game objects can have children with
obj.add()
now which share the parent transform - (BREAK) raised esbuild target to
esnext
- ➕ added
make()
to make a game object without adding to the scene - ➕ added support for
add()
to add unattached game objects to the sceneadd(make([...comps]))
- ➕ added
colors
option todrawPolygon()
that controls the color of each corner - ➕ added
gradient
option todrawRect()
that specifies the start and end color - ➕ added
loadProgress()
that returns a0.0 - 1.0
that indicates current asset loading progress - ➕ added
kaboom()
optionloadingScreen
where you can turn off the default loading screen - ➕ added
drawMasked()
anddrawSubtracted()
- (BREAK) removed
layers()
in favor of parent game objects (see "layers" demo) - ➕ added
pushRotateX()
,pushRotateY()
andpushRotateZ()
- ➕ added
pixelDensity
option tokaboom()
- ➕ added support for non bitmap fonts
- (BREAK) rename
loadFont()
toloadBitmapFont()
- ➕ added
loadFont()
to load.ttf
,.otf
,.woff2
or any font supported by browserFontFace
- (BREAK)
origin
no longer controls text alignment, usealign
option instead - ➕ added
quit()
to end everything - 🔊 shader error logs now yields the correct line number
- ⚡️ changed object update order from reversed to not reversed
- ➕ added
download()
,downloadText()
,downloadJSON()
,downloadBlob()
- ➕ added
Recording#stop()
to stop the recording and returns the video data as mp4 Blob - ➕ added
debug.numFrames()
to get the total number of frames elapsed - 🛠 fixed visual artifacts on text
- ➕ added
onError()
to handle error or even custom error screen - ➕ added
onLoading()
to register a custom loading screen (see "loader" example) - 🛠 fixed touches not treated as mouse
- (BREAK) changed
onTouchStart()
,onTouchMove()
andonTouchEnd()
callback signature to(pos: Vec2, touch: Touch) => void
(exposes the nativeTouch
object) - ➕ added
onResize()
to register an event that runs when canvas resizes - (BREAK)
GameObj#_id
has been renamed toGameObj#id
- (BREAK) removed
load()
event for components, useonLoad()
inadd()
event - (BREAK) renamed
Body#onFall()
toBody#onFallOff()
which triggers when object fall off a platform, addedBody#onFall()
which fires when object starts falling - (BREAK)
addLevel()
now returns aGameObj
which has all individual grid objects as its children game objects, withLevelComp
containing its previous methods - (BREAK) defining
gravity()
is now required for enabling gravity,body()
by default will only prevent objects from going through each other, removedsolid()
in favor ofbody({ isStatic: true })
- (BREAK) renamed
Body#weight
toBody#gravityScale
- (BREAK) removed
GameObj#every()
andGameObj#revery()
in favor ofobj.get().forEach()
- ➕ added
GameObj#getAll()
for recursively getting children game objects (get()
only gets from direct children) - ➕ added
Area#onCollisionActive()
andArea#onCollisionEnd()
events - ✂ removed
debug.objCount()
in favor ofgetAll().length
- ➕ added
debug.numFrames()
to get the current frame count - (BREAK) renamed
cursor()
tosetCursor()
- (BREAK) renamed
fullscreen()
tosetFullscreen()
- 🚚 moved type defs for global functions to
import "kaboom/global"
- (BREAK) removed
apl386
andapl386o
as default fonts, default font changed tosink
,, and added a default font size of16
- brought back
-
v2000.2.6 Changes
- 🛠 fixed text always being wrapped if updated
- 🛠 fixed text comp properties
letterSpacing
,charSpacing
,transform
,styles
not being exposed
-
v2000.2.5 Changes
- 🛠 fixed updating
font
property on gameobj not updating the text font
- 🛠 fixed updating
-
v2000.2.4 Changes
- 🛠 fixed
focus()
not properly exported - 🗄 deprecated
focus()
in favor ofcanvas.focus()
due to name collision
- 🛠 fixed
-
v2000.2.3 Changes
- 🛠 fixed
kaboom.d.ts
completely messed up
- 🛠 fixed
-
v2000.2.2 Changes
- 🛠 fixed doc for
TextCompOpt#styles
andDrawTextOpt#styles
- 🛠 fixed doc for
-
v2000.2.1 Changes
- 🛠 fixed updates not running at all when
kaboom({ debug: false })
- 🛠 fixed updates not running at all when
-
v2000.2.0 Changes
- ➕ added
formatText()
anddrawFormattedText()
- ➕ added
charSpacing
andlineSpacing
inTextCompOpt
andDrawTextOpt
- ➕ added optional
transitions
argument instate()
to define allowed transitions - ➕ added
StateComp#onStateTransition
to register event for specific transitions - ➕ added syntax to style a piece of text
"this is a [styled].wavy text"
andstyle
option inTextCompOpt
andDrawTextOpt
to define the styles withCharTransformFunc
- 🗄 deprecated
dir()
in favor ofVec2.fromAngle()
- 🛠 fixed
onTouchEnd()
fired ontouchmove
- ➕ added
outview()
component to control behavior when object leaves visible area - 🗄 deprecated
cleanup(delay?: number)
in favor ofcleanup(opt?: CleanupOpt)
- 🗄 deprecated
mouseWorldPos()
in favor oftoWorld(mousePos())
- 🗄 deprecated
rng()
in favor ofnew RNG()
- ➕ added classes
Vec2
,Color
,Mat4
,Timer
,Quad
,RNG
,Line
,Rect
,Circle
- ➕ added deprecation warning
- 🛠 fixed letterbox view mode
- 👍 allow non-stretch letterbox
- 🛠 fixed mouse position malfunction in fullscreen, stretch and letterbox mode
- ➕ added
-
v2000.1.8 Changes
- 🛠 fixed
Color#eq()
not giving correct result
- 🛠 fixed