Fixed examples
This commit is contained in:
parent
9cc37775a3
commit
d739a6786b
1 changed files with 13 additions and 13 deletions
26
README.md
26
README.md
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue