Fixed examples

This commit is contained in:
MeowcaTheoRange 2022-08-08 12:07:39 -05:00 committed by GitHub
parent 9cc37775a3
commit d739a6786b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,11 +51,11 @@ A tween library for Kaboom that allows easy usage of tweens. It also comes with
## Example ## Example
```js ```js
import { KBTween } from "./KBTweenV2/tween.js"; import { KBTween } from ".../tween.js";
import { easings } from ".../easingpackage.js";
kaboom({ var k = kaboom(); // Make Kaboom global but also a variable
plugins: [KBTween] var twnlib = KBTween(k); // Create new TweenLib instance, pass in Kaboom
});
loadBean(); loadBean();
@ -65,21 +65,21 @@ var bean = add([
color(255, 255, 255) color(255, 255, 255)
]); ]);
tween(bean.pos, [ "x" ], { twnlib.tween(bean.pos, [ "x" ], {
from: 64, from: 0,
to: 512, to: width() - 64,
time: 1.2, time: 3.2,
type: 8 type: 8
}); });
var stopTween = tween(bean.pos, [ "y" ], { twnlib.tween(bean.pos, [ "y" ], {
from: 64, from: 0,
to: 512, to: height() - 64,
time: 0.7, time: 2,
type: 8 type: 8
}); });
tween(bean.color, [ "b" ], { twnlib.tween(bean.color, [ "g", "r" ], {
from: 255, from: 255,
to: 0, to: 0,
time: 0.25, time: 0.25,