scripting improvements
This commit is contained in:
@@ -7,30 +7,23 @@ function MoveCubeCutscene(params) {
|
||||
|
||||
var startX = this.cube.position.position.x;
|
||||
|
||||
// this.animLeft = new Animation([
|
||||
// { time: 0.0, value: startX, easing: Easing.outQuad },
|
||||
// { time: DURATION, value: startX - SPEED * DURATION }
|
||||
// ]);
|
||||
this.anim = new Animation([
|
||||
[
|
||||
{ time: 0.0, value: startX, easing: Easing.outQuad },
|
||||
{ time: DURATION, value: startX - SPEED * DURATION, easing: Easing.inOutQuad },
|
||||
{ time: DURATION * 2, value: startX }
|
||||
]
|
||||
]);
|
||||
|
||||
// this.animRight = new Animation([
|
||||
// { time: 0.0, value: startX - SPEED * DURATION, easing: Easing.inOutQuad },
|
||||
// { time: DURATION, value: startX }
|
||||
// ]);
|
||||
this.anim.onComplete = function() { Cutscene.finish(); };
|
||||
}
|
||||
|
||||
MoveCubeCutscene.prototype = Object.create(Cutscene.prototype);
|
||||
MoveCubeCutscene.prototype.constructor = MoveCubeCutscene;
|
||||
|
||||
MoveCubeCutscene.prototype.update = function() {
|
||||
Cutscene.finish();
|
||||
// if(!this.animLeft.complete) {
|
||||
// this.cube.position.position.x = this.animLeft.update(TIME.delta);
|
||||
// } else {
|
||||
// this.cube.position.position.x = this.animRight.update(TIME.delta);
|
||||
// if(this.animRight.complete) {
|
||||
// Cutscene.finish();
|
||||
// }
|
||||
// }
|
||||
this.anim.update(TIME.delta);
|
||||
this.cube.position.position.x = this.anim.properties[0].value;
|
||||
};
|
||||
|
||||
module = MoveCubeCutscene;
|
||||
|
||||
Reference in New Issue
Block a user