mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-08 00:10:05 +08:00
Progress: #3
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user