-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from waynemwashuma/dev
Dev
- Loading branch information
Showing
346 changed files
with
25,185 additions
and
18,414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,4 @@ res.json | |
*.mp3 | ||
tests | ||
*.res.js | ||
*.txt | ||
animations | ||
*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { | ||
Vector2, | ||
Sprite, | ||
BufferGeometry, | ||
BasicMaterial, | ||
Tween, | ||
createEntity, | ||
Vector2Update, | ||
Easing | ||
} from "/src/index.js" | ||
let path = [ | ||
new Vector2(-25,-25), | ||
new Vector2(-25,25), | ||
new Vector2(25,25), | ||
new Vector2(25,-25) | ||
] | ||
let geometry = new BufferGeometry(path) | ||
let material = new BasicMaterial() | ||
|
||
material.fill = "blue" | ||
|
||
export function animation(manager) { | ||
let tweener = manager.getSystem("tween") | ||
|
||
let box = createEntity(200, 100) | ||
let tween = new Tween( | ||
box.get("transform").position | ||
) | ||
let tween2 = new Tween( | ||
box.get("transform").position | ||
) | ||
tween | ||
.from(new Vector2(200, 200)) | ||
.to(new Vector2(200, 1200)) | ||
.duration(4) | ||
.onUpdate(Vector2Update) | ||
.easing(Easing.linear).play() | ||
|
||
tween2 | ||
.from(new Vector2(200, 1200)) | ||
.to(new Vector2(200, 200)) | ||
.duration(4) | ||
.onUpdate(Vector2Update) | ||
.easing(Easing.linear) | ||
tween.chain(tween2) | ||
tween2.chain(tween) | ||
box.attach("sprite", new Sprite( | ||
geometry, material | ||
)) | ||
manager.add(box) | ||
tweener.add(tween2) | ||
tweener.add(tween) | ||
console.log(tweener); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.