From c6db564e22bec13c7c98efff86d7d603a32dfd0b Mon Sep 17 00:00:00 2001 From: zBlade Date: Mon, 29 Apr 2024 11:43:16 -0400 Subject: [PATCH] Update docs to fix compile bug --- README.md | 2 ++ documentation/docs/game/keyManager.md | 16 +++++++++++++--- typedoc.config.json | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bdb90def..4d39b7a2 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 78d3357f..4ed064ec 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 bf9e8ad9..c661c65e 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",