hold on...

This commit is contained in:
MeowcaTheoRange 2022-08-09 12:41:35 -05:00 committed by GitHub
parent 37534fc9f6
commit 7314bdc09d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
# KBTweenLib # KBTweenLib
A tween library for Kaboom that allows easy usage of tweens. It also comes with a package for eases, so you can use it with Kaboom's `lerp()` function if you really wanted. A tween library for Kaboom that allows easy usage of tweens. It also comes with a package for eases, so you can use it with Kaboom's `lerp()` function if you really wanted.
## Dependencies ## Dependencies
### `tween.js` ### `KBTween.js`
- **Requires** Kaboom v2000 or later - **Requires** Kaboom v2000 or later
- **Requires** a JavaScript version that supports ES6 functionality - **Requires** a JavaScript version that supports ES6 functionality
- **Recommends** Visual Studio Code - **Recommends** Visual Studio Code
@ -9,14 +9,14 @@ A tween library for Kaboom that allows easy usage of tweens. It also comes with
### `easingpackage.js` ### `easingpackage.js`
- **Requires** a JavaScript version that supports ES6 functionality - **Requires** a JavaScript version that supports ES6 functionality
- **Can be used with** Kaboom, any version - **Can be used with** Kaboom, any version
## Differences between `tween.js` and `tween_nokaboom.js` ## Differences between `KBTween.js` and `JSTween.js`
### `tween.js` ### `KBTween.js`
- Smaller file size, but depends heavily on Kaboom functions - Smaller file size, but depends heavily on Kaboom functions
- Perfect for Kaboom games - Perfect for Kaboom games
- Uses `onUpdate()`, `lerp()`, and `time()` - Uses `onUpdate()`, `lerp()`, and `time()`
### `tween_nokaboom.js` ### `JSTween.js`
- Bigger file size, but not dependent on Kaboom at all - Bigger file size, but not dependent on Kaboom at all
- Uses `performance.now()`, a very precise and lightweight time getter function - Uses `performance.now()`, a very precise and lightweight time getter function
- Do not use while making a Kaboom game, it would be pointless! Use for normal JS Canvas games instead. - Do not use while making a Kaboom game, it would be pointless! Use for normal JS Canvas games instead.
@ -64,7 +64,7 @@ A tween library for Kaboom that allows easy usage of tweens. It also comes with
- private `__NOOP: Function` - private `__NOOP: Function`
## Example ## Example
`tween.js` `KBTween.js`
```js ```js
import { KBTween } from ".../tween.js"; import { KBTween } from ".../tween.js";
import { easings } from ".../easingpackage.js"; import { easings } from ".../easingpackage.js";
@ -102,16 +102,16 @@ twnlib.tween(bean.color, [ "g", "r" ], {
type: tweentypes.PINGPONG type: tweentypes.PINGPONG
}); });
``` ```
`tween_nokaboom.js` `JSTween.js`
```html ```html
<p>Points: <span id="number">0</span></p> <p>Points: <span id="number">0</span></p>
<script type="module" src="...js"></script> <script type="module" src="...js"></script>
``` ```
```js ```js
import { KBTween } from ".../tween_nokaboom.js"; import { JSTween } from ".../JSTween.js";
import { easings } from ".../easingpackage.js"; import { easings } from ".../easingpackage.js";
var twnlib = KBTween(); var twnlib = JSTween();
twnlib.tween(document.getElementById("number"), ["innerHTML"], { twnlib.tween(document.getElementById("number"), ["innerHTML"], {
from: 0, from: 0,