diff --git a/README.md b/README.md index bdb90de..4d39b7a 100644 --- a/README.md +++ b/README.md @@ -59,11 +59,13 @@ coins.static.buyUpgrade("upg1Coins"); // Hotkeys coinGame.keyManager.addKey([ { + id: "gainCoins", name: "Gain Coins", key: "g", onDownContinuous: () => coins.static.gain(), }, { + id: "buyUpgrades", name: "Buy Upgrades", key: "b", onDownContinuous: () => coins.static.buyUpgrade("upg1Coins"), diff --git a/documentation/docs/game/keyManager.md b/documentation/docs/game/keyManager.md index 78d3357..4ed064e 100644 --- a/documentation/docs/game/keyManager.md +++ b/documentation/docs/game/keyManager.md @@ -17,13 +17,23 @@ import { myGame } from "./game.js"; const keyManager = myGame.keyManager; -// Add a key binding +// Add a key binding (not recommeneded) keyManager.addKey("Move Up", "w", () => player.velocity.y += player.acceleration.y); // Add multiple key bindings keyManager.addKeys([ - { id: "moveUp", name: "Move Up", key: "w", onDownContinuous: () => player.velocity.y += player.acceleration.y }, - { id: "moveUp", name: "Move Down", key: "s", onDownContinuous: () => player.velocity.y -= player.acceleration.y }, + { + id: "moveUp", // Required + name: "Move Up", // Optional + key: "w", // Key to press (required) + onDownContinuous: () => player.velocity.y += player.acceleration.y, + }, + { + id: "moveUp", + name: "Move Down", + key: "s", + onDownContinuous: () => player.velocity.y -= player.acceleration.y, + }, // Add more key bindings here... ]); ``` diff --git a/typedoc.config.json b/typedoc.config.json index bf9e8ad..c661c65 100644 --- a/typedoc.config.json +++ b/typedoc.config.json @@ -4,6 +4,7 @@ "exclude": [ "**/node_modules/**", "**/test/**", + "examples/**", "src/classes/skillTree.ts", "src/index.ts", "src/game/index.ts",