Random ships for the example

This commit is contained in:
Jeremiah Billmann
2013-08-02 21:53:48 -04:00
parent 8eab8638fb
commit 976118d1aa
3 changed files with 16 additions and 11 deletions
+2
View File
@@ -8,6 +8,7 @@
state.ang = 0;
state.x = 0;
state.y = 0;
state.ship = Math.floor(Math.random() * 9) + 1;
}
for (i = 0; i < inputs.length; i ++) {
@@ -59,6 +60,7 @@
interpolationState.x = (previousState.x + amount * (targetState.x - previousState.x));
interpolationState.y = (previousState.y + amount * (targetState.y - previousState.y));
interpolationState.ang = (previousState.ang + amount * (targetState.ang - previousState.ang));
interpolationState.ship = targetState.ship;
return interpolationState;
};