Progress: Interpolation

This commit is contained in:
Jeremiah Billmann
2013-06-26 20:17:55 -04:00
parent 3d8fe0790f
commit 536238e902
4 changed files with 119 additions and 21 deletions
+8
View File
@@ -21,6 +21,14 @@ $(function () {
}
}
return state;
},
onInterpolation: function (previousState, targetState, amount) {
var newState = {};
newState.x = (previousState.x + amount * (targetState.x - previousState.x));
newState.y = (previousState.y + amount * (targetState.y - previousState.y));
return newState;
}
});