This commit is contained in:
Jeremiah Billmann
2013-07-14 11:16:43 -04:00
parent 2e714b80ce
commit 710f33a753
4 changed files with 27 additions and 7 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
(function(exports){
exports.getNewState = function (state, inputs, deltaTime) {
exports.getNewPlayerState = function (state, inputs, deltaTime) {
var i = 0;
if (!state.x && !state.y) {
@@ -16,11 +16,17 @@
state.y += (50 * deltaTime);
} else if (inputs[i].input === 'up') {
state.y -= (50 * deltaTime);
} else if (inputs[i].input === 'space') {
}
}
return state;
};
exports.getNewEntityState = function (state, deltaTime) {
};
exports.getInterpolatedState = function (previousState, targetState, amount) {
var interpolationState = {};
interpolationState.x = (previousState.x + amount * (targetState.x - previousState.x));