diff --git a/CHANGELOG.2.2.0.md b/CHANGELOG.2.2.0.md new file mode 100644 index 00000000..d3a12198 --- /dev/null +++ b/CHANGELOG.2.2.0.md @@ -0,0 +1,27 @@ +# 2.2.0 Changelog - 2022-04-4 + +This update improves and adds flexibility to rendering. + +This update overhauls the physics system by adding a complete new SAT collision system with different shaped hitboxes and multiple adjustable +hitboxes for PhysicsBody. + +This update overhauls the sound system by adding support for WebAudio and fallback to HTMLAudio. + +This update improves the animation system by adding Tweens and more. + +------------------------------------------------------------------------------------------------------ + +## Added + +## Changed + +- Misc + - Changed startup message and version + +## Removed + +## Deprecated + +## Fixed + +## FaQ diff --git a/package.json b/package.json index d5a54b42..4466ac3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "duckengine", - "version": "2.1.0", + "version": "2.2.0", "description": "A 2D Game Engine for the web.", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/core/renderer/models/color.ts b/src/core/renderer/models/color.ts new file mode 100644 index 00000000..b1134c7d --- /dev/null +++ b/src/core/renderer/models/color.ts @@ -0,0 +1,23 @@ +import hexNumberToString from '../../../utils/hexNumberToString'; + +export default class Color { + public value: string | CanvasGradient; + public stroke?: number | string; + public strokeWidth?: number; + + constructor( + value: number | string | CanvasGradient, + stroke?: number | string, + strokeWidth?: number + ) { + // convert value so that the CanvasRenderer can skip this step + typeof value === 'number' ? (value = hexNumberToString(value)) : value; + typeof stroke === 'number' + ? (stroke = hexNumberToString(stroke)) + : stroke; + + this.value = value; + this.stroke = stroke; + this.strokeWidth = strokeWidth; + } +} diff --git a/src/helper/startup.ts b/src/helper/startup.ts index 12811625..5b5f3469 100644 --- a/src/helper/startup.ts +++ b/src/helper/startup.ts @@ -7,5 +7,5 @@ https://github.com/ksplatdev/DuckEngine MIT License -Copyright (c) 2021 Bleart Emini +Copyright (c) 2022 Bleart Emini `; diff --git a/src/helper/version.ts b/src/helper/version.ts index 6bbb04c1..d6aa1be8 100644 --- a/src/helper/version.ts +++ b/src/helper/version.ts @@ -1 +1 @@ -export default '2.1.0'; +export default '2.2.0'; diff --git a/src/utils/hexNumberToString.ts b/src/utils/hexNumberToString.ts new file mode 100644 index 00000000..61108763 --- /dev/null +++ b/src/utils/hexNumberToString.ts @@ -0,0 +1,3 @@ +export default function hexNumberToString(hex: number) { + return hex.toString(16); +}