//#CLIENTSIDE
function onCreated() {
join("tweening");
this.tweens = NULL; // Make sure there are no tweens in the queue
// Set some NPC Prefs
this.x=10;
this.y=10;
this.image = "block.png";
addTween({
"this.x", // property
this.x+20, // to-value
"easeOutQuad", // easing
100, // steps
"Sequence" // Parallel / Sequence
});
addTween({
"this.y",
this.y+20,
"easeOutBounce",
100,
"Sequence"
});
setTimer(0.05);
}
function onTimeout() {
// Your script does it's other functions here
setTimer(0.05);
runTween(); // runTween must go after the setTimer to catch the timeout var
}
The examples in the video below (also find a link to a higher-def version on the youtube page) are Parallel and Blocking but as you can see it's very easy to make changes and use different variables.
Of course, "tween" means nothing to most of us (I knew what it meant; didn't realize that you meant to completely replicate something like Flash's tweening)
Of course, "tween" means nothing to most of us (I knew what it meant; didn't realize that you meant to completely replicate something like Flash's tweening)
I never really thought that this was a replication of Flash's motion tweening to be honest, but I guess it really does act in a very similar manner, although it does not take into account flash's timeline and such. More over it has it's own internal timeline.
I'm going to keep working on this, and if anyone has any ideas for optimising or improving let me know!