Skip to content

Commit

Permalink
fix($code): formatting, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cstuncsik committed Sep 27, 2016
1 parent 4a5b478 commit 4a79f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var loop = createGameLoop({
| **fpsFilterStrength** | Number | 20 | *How often should FPS measurement change (1 means every frame)* |
| **slow** | Number | 1 | *Slow motion coefficient (the bigger the slower)* |
| **input** | Function | N/A | *This function is responsible for processing input* |
| **update** | Function(updateTimeStep:Number) | N/A | *This function is responsible for updating game objects' properties, physics etc...* |
| **update** | Function(step:Number) | N/A | *This function is responsible for updating game objects' properties, physics etc...* |
| **render** | Function(interpolation:Number) | N/A | *This function is responsible for drawing game objects* |

#### Returned *object*
Expand Down
6 changes: 3 additions & 3 deletions src/gameLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
lag += Math.min(sec, delta);
while (lag >= slowStep) {
lag -= slowStep;
update(updateTimeStep/slowStep);
update(updateTimeStep / slowStep);
}
frameTime += (delta - frameTime) / fpsFilterStrength;
render(lag / slowStep);
}

function start() {
then = performance.now();
if(!first){
if (!first) {
first = true;
beginning = then;
}
Expand All @@ -65,7 +65,7 @@
return (then - beginning) / sec;
}

function setSlow(slow){
function setSlow(slow) {
slowStep = slow * updateTimeStep;
}

Expand Down

0 comments on commit 4a79f6f

Please sign in to comment.