fix goofy formatting of md

This commit is contained in:
Theis Pieter Hollebeek 2025-10-13 11:30:10 +02:00
parent e86aca5de0
commit c756d6de95

View File

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