Skip to content

Commit

Permalink
doc: better changelog using Keep a Changelog (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel authored Dec 18, 2024
1 parent 54814bb commit 042cbe7
Showing 1 changed file with 100 additions and 47 deletions.
147 changes: 100 additions & 47 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# v4000.0.0 (unreleased)
# Changelog

All notable changes to this project will be documented in this file.

The format is (mostly) based on
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4000.0.0] - TBD

### Added

- Added `clipLineToRect()`
- Replaced the Separating Axis Theorem (SAT) with the "Gilbert–Johnson–Keerthi"
(`GJK`) distance algorithm.
- Added circle and (rotated) ellipse collision shapes.
- Added `ellipse()` component.
- Circle area is no longer a box.
- Added restitution and friction.
- Objects can switch parent by assigning the parent property or using setParent.
- Added a fake cursor API.
- Added circle and (rotated) ellipse collision shapes.
- Added `clipLineToRect()`
- Added support to circle shapes in `area()`.
- Added `obj.setParent()` to change the parent of a game object.
- Added `fakeMouse()` to create a fake mouse cursor.

```js
const myCursor = add([fakeMouse(), sprite("kat"), pos(100, 100)]);
Expand All @@ -17,23 +24,69 @@
myCursor.release();
myCursor.move(vec2(100, 200)); // move as your wish
```
- Added restitution and friction.
- Added `k.system()` to replace internal events or create new.

```js
system("collision", () => {
// system code
}, [LCEvents.AfterFixedUpdate, LCEvents.AfterUpdate]),
```
- Added LCEvents enum for identify different lifecycle events.

# v3001.0.5
### Changed

- Replaced the Separating Axis Theorem (SAT) with the "Gilbert–Johnson–Keerthi"
(`GJK`) distance algorithm.
- Changed default behaviour of `kaplay({ tagsAsComponents: false })` to `false`.

## [3001.0.5] - TBD

### Added

- Added tags and components separation in `KAPLAYOpt.tagsAsComponents`
**experimental**
- Added `.is()`, `.tag()` and `.untag()` to `GameObjRaw`, check, add and remove
- Added `.has()` to `GameObjRaw`, to check if a game object has a component tags
**experimental**
- Added events for listen to comps being removed or added `onUse()` and
`onUnused()` **experimental**
- Added `k.cancel()` to cancel the current event **experimental**
- ```js
onKeyPress("space", () => {
// do something
// cancel the event
return cancel();
});
```
- Added `getDefaultLayer()` to get the default layer (experimental)
**experimental**
- Added `getLayers()` to get the layers list (experimental) **experimental**
- Added many JSDoc specifiers on many functions (@require, @deprecated, @since,
@group, etc)
- Fixed artifacts present in some TrueType fonts.

### Changed

- Added `.use()`, `.unuse()` and `.has()` to `GameObjRaw`, to add, remove and
check components. This only works with `KAPLAYOpt.tagsAsComponents` set to
`true` **experimental**

### Deprecated

- Deprecated camera methods `camScale()`, `camPos()` and `camRot()` in favor of
`setCamScale()`, `getCamScale()`, `setCamPos()`, `getCamPos()`, `setCamRot()`
and `getCamRot`.
- Deprecated `camTransform()` in favor of `getCamTransform()`.
- Deprecated `camFlash()` in favor of `flash()`, for a `shake()`-like name.
- Added `getLayers()` to get the layers list (experimental)
- Added `getDefaultLayer()` to get the default layer (experimental)

# v3001.0.0: Spooky Beans!
### Fixed

- Fixed artifacts present in some TrueType fonts.
- Fixed `.use()` and `.unuse()` with area components.

## [3001.0.0] "Spooky Beans!" - 2024-10-31

## Input
### Input

- Added input bindings, `onButtonPress`, `onButtonRelease`, `onButtonDown`, and
it's corresponding boolean versions, `isButtonPressed`, `isButtonDown` and
Expand Down Expand Up @@ -102,7 +155,7 @@
});
```

## Physics
### Physics

- added effector components: `areaEffector()`, `buoyancyEffector()`,
`pointEffector()`, `surfaceEffector()`.
Expand All @@ -113,7 +166,7 @@
- added `pathfinder()` component to calculate a list of waypoints on a graph.
- now collision checks are only done if there's area objects.

## Game Object
### Game Object

- added `getTreeRoot()` to get the game's root object, which is the parent of
all other objects
Expand All @@ -134,7 +187,7 @@
debug.log(obj.tags); // ["enemy", "dangerous"]
```

## Components
### Components

- added support to setters/getters syntax in `ScaleComp` and `SpriteComp`
components
Expand All @@ -147,7 +200,7 @@
obj.sprite = "bag";
```

## Rendering and Animation
### Rendering and Animation

- added the `animate()` component to _animate_ the properties of an object using
keyframes. Check out
Expand Down Expand Up @@ -247,7 +300,7 @@
- Added `SpriteComp.animFrame` to get the frame of the current animation (not on
the spritesheet)

## Audio
### Audio

- now you can pass an `AudioBuffer` to `loadSound()`
- added `loadMusic()` to load streaming audio (doesn't block in loading screen).
Expand All @@ -259,7 +312,7 @@
play("bgm");
```

## Math
### Math

- added `Vec2.fromArray()` to convert an array to a `Vec2`.

Expand Down Expand Up @@ -288,7 +341,7 @@
shuffle(numbers); // [3, 1, 5, 2, 4]
```

## Debug mode
### Debug mode

- added `outline()`, `shader()`, and `area()` properties to `debug.inspect`.
- added `KAPLAYOpt.debugKey` for customizing the key used to toggle debug mode.
Expand Down Expand Up @@ -319,7 +372,7 @@

- Now `debug.log()` accepts multiple argument of any type, like `console.log()`.

## Helpers
### Helpers

- added `getSceneName()` to get the current scene name
- added `Color.toArray()` to convert a color to an array
Expand All @@ -334,7 +387,7 @@
- added evaluation of the first and second derivatives for all splines
- added higher order easing functions linear, steps and cubic-bezier

## TypeScript
### TypeScript

- Now you can type `get()` with a type parameter and passing component types.
(**v4000**)
Expand All @@ -350,7 +403,7 @@
- Now `loadShader()` and `loadShaderURL()` accepts null for unused parameters.
- Now `RectCompOpt` accepts a array of numbers for `radius`.

## Deprecations
### Deprecations

> All changes applies for both v3001 and v4000
Expand All @@ -360,7 +413,7 @@
- deprecated `Event`, `EventHandler` and `EventController` in favor of `KEvent`,
`KEventHandler` and `KEventController`

## Bug fixes
### Bug fixes

> All changes applies for both v3001 and v4000
Expand Down Expand Up @@ -492,7 +545,7 @@ getSprite("bean").then((spr) => {

- fixed some indirect `fixed` related issues

## v3000.1
## [3000.1.0] - 2023-08-18 (kaboom.js)

- added game object level input handling

Expand Down Expand Up @@ -576,9 +629,9 @@ ui.add([rect(100, 100)]);
reset it?
- fixed incorrect touch position when canvas is not at top left of page

# v3000
## [3000.0.0] - 2023-05-25 (kaboom.js)

## Game Objects
### Game Objects

- added scene graph, game objects are now stored in a tree-like structure and
can have children with `obj.add()`
Expand Down Expand Up @@ -632,7 +685,7 @@ console.log(enemies.length); // 4
- added `onAdd()` and `onDestroy()` events to listen to added / destroyed game
objects

## Components
### Components

- added support for getter and setters in component properties

Expand Down Expand Up @@ -753,7 +806,7 @@ const player = add([
]);
```

## Assets
### Assets

- added `loadProgress()` that returns a `0.0 - 1.0` that indicates current asset
loading progress
Expand Down Expand Up @@ -786,7 +839,7 @@ loadSprite("player", [
- (**BREAK**) added `loadShaderURL()`, `loadShader()` now only load shader code
not files

## Text
### Text

- added `loadFont()` to load `.ttf`, `.otf`, `.woff2` or any font supported by
browser `FontFace`
Expand Down Expand Up @@ -815,7 +868,7 @@ loadFont("apl386", "/examples/fonts/apl386.ttf", {
"[green]oh hi[/green] here's some [wavy]styled[/wavy] text";
```

## Graphics
### Graphics

- fixed visual artifacts on text rendering
- added `colors` option to `drawPolygon()` that controls the color of each
Expand Down Expand Up @@ -867,7 +920,7 @@ onMouseMove(() => {
});
```

## Audio
### Audio

- added option `kaboom({ backgroundAudio: false })` to not pause audio when tab
not active
Expand All @@ -889,7 +942,7 @@ music.volume = 0.5;
music.loop = true;
```

## Input
### Input

- added `onScroll(action: (delta: Vec2) => void)` to listen mouse wheel scroll
- fixed touches not treated as mouse
Expand All @@ -905,7 +958,7 @@ music.loop = true;
- added `onGamepadConnect()` and `onGamepadDisconnect()`
- added `gamepads` option to `kaboom()` to define custom gamepads

## Level
### Level

- (**BREAK**) changed `addLevel()` options API
- renamed `width` and `height` to `tileWidth` and `tileHeight`
Expand Down Expand Up @@ -946,7 +999,7 @@ addLevel(["@ ^ $$", "======="], {
});
```

## Misc
### Misc

- sprites are now automatically packed, improving performance
- (**BREAK**) renamed `gravity()` into `getGravity()` and `setGravity()`
Expand Down Expand Up @@ -1052,7 +1105,7 @@ timer.resume();
- (**BREAK**) removed `debug.objCount()` in favor of `getAll().length`
- added `debug.numFrames()` to get the current frame count

### v2000.2.6
## [2000.2.6] - 2022-01-27 (kaboom.js)

- fixed text always being wrapped if updated
- fixed text comp properties `letterSpacing`, `charSpacing`, `transform`,
Expand All @@ -1079,7 +1132,7 @@ timer.resume();

- fixed updates not running at all when `kaboom({ debug: false })`

## v2000.2 "Fancy Text Mode"
## [2000.2.0] "Fancy Text Mode" 2022-01-23 (kaboom.js)

- added `formatText()` and `drawFormattedText()`
- added `charSpacing` and `lineSpacing` in `TextCompOpt` and `DrawTextOpt`
Expand All @@ -1103,7 +1156,7 @@ timer.resume();
- allow non-stretch letterbox
- fixed mouse position malfunction in fullscreen, stretch and letterbox mode

### v2000.1.8
### [2000.1.8]

- fixed `Color#eq()` not giving correct result

Expand Down Expand Up @@ -1133,7 +1186,7 @@ timer.resume();

- fixed `StateComp#enterState()` not accepting any state

## v2000.1 "Record Mode"
## [2000.1.0] "Record Mode" - 2021-11-04 (kaboom.js)

- added `hsl2rgb()` for converting HSL color to kaboom RGB
- added `record()` to start a screen recording
Expand Down Expand Up @@ -1194,7 +1247,7 @@ timer.resume();
- `AudioPlay#isStopped()`
- `AudioPlay#isPaused()`

# v2000 "Burp Mode"
## [2000.0.0] "Burp Mode" - 2021-10-20 (kaboom.js)

- version jumped to v2000.0.0 (still semver, just big)
- added `burp()` for easy burping
Expand Down Expand Up @@ -1426,7 +1479,7 @@ if (area.shape === "rect") {
- added plugins npm package support e.g.
`import asepritePlugin from "kaboom/plugins/aseprite"`

# v0.5 "Sticky Type"
## [0.5.0] "Sticky Type" - 2021-05-11 (kaboom.js)

- platforms are now sticky
- moved to TypeScript
Expand Down Expand Up @@ -1468,7 +1521,7 @@ if (area.shape === "rect") {
- fixed `on("destroy")` handler getting called twice
- fixed sprite `play()` not playing

# v0.4 "Multiboom"
## [0.4.0] "Multiboom" - UNKNOWN (kaboom.js)

- **BREAK** removed `init()` and `kaboom.global()`, in favor of `kaboom()`, also
allows multiple kaboom games on one page
Expand Down Expand Up @@ -1505,7 +1558,7 @@ k.vec2();
- added `numFrames()` by `sprite()`
- added `screenshot()` that returns of a png base64 data url for a screenshot

# v0.3 "King Dedede...Bug!"
## [0.3.0] "King Dedede...Bug!" - UNKNOWN

- **BREAK** removed `pause()` and `paused()` in favor to `kaboom.debug.paused`
- **BREAK** removed `velY`, `curPlatform` and `maxVel` fields by `body()`
Expand All @@ -1523,7 +1576,7 @@ k.vec2();
- added on screen logging with `log()` and `error()`
- fixed `loadRoot()` sometimes doesn't work in async tasks

# v0.2 "Hear the Tremble"
## [0.2.0] "Hear the Tremble" - UNKNOWN

- **BREAK** removed `aseSpriteSheet` conf field from
`loadSprite(name, src, conf)`
Expand All @@ -1548,7 +1601,7 @@ k.vec2();
- added `readd()` to re-add an object to the scene without triggering events
- added `level.spawn()`

# v0.1 "Oh Hi Mark"
## [0.1.0] "Oh Hi Mark" -

- **BREAK** changed default origin point to `"topleft"`, so if you want object
origin point to be at center you'll need to manual `origin("center")`
Expand Down

0 comments on commit 042cbe7

Please sign in to comment.