diff --git a/docs/gamelib.md b/docs/gamelib.md index f215dfb..1c242da 100644 --- a/docs/gamelib.md +++ b/docs/gamelib.md @@ -57,10 +57,8 @@ lib.onPress("a", function () { function dWasPressed() { playerX += 20; } -lib.onPress( - "a", - dWasPressed, -); /* note the lack of () after dWasPressed - we are not calling the function, we are referring to it as a variable */ +// note the lack of () after dWasPressed - we are not calling the function, we are referring to it as a variable +lib.onPress("a", dWasPressed); ``` ### `LoopFunc` @@ -97,9 +95,8 @@ lib.startGameLoop(function (deltaT) { function loopFunction(deltaTime) { playerX += 20 * deltaTime; } -lib.startGameFunction( - loopFunction, -); /* note the lack of () after loopFunction - we are not calling the function, we are using it as a variable */ +// note the lack of () after loopFunction - we are not calling the function, we are using it as a variable +lib.startGameFunction(loopFunction); ``` ## Functions @@ -157,6 +154,7 @@ Example: ```ts let isJumping = false; + lib.onPress(" ", function () { isJumping = true; });