diff --git a/ModuleApiGameLibGameDetails.md b/ModuleApiGameLibGameDetails.md index cfca06d..41564ae 100644 --- a/ModuleApiGameLibGameDetails.md +++ b/ModuleApiGameLibGameDetails.md @@ -27,8 +27,44 @@ The game details decribe basic information about the game and specifies how the | description | string | The description of the game. | | hints | string[] | List of hints for the game. | | (Optional) icon | string | Path to the icon of the module. | -| controls | [Control](ModuleApiGameLibGameDetails#Control) | Statistics rows to show on the endscreen. | +| controls | [Control](ModuleApiGameLibGameDetails#control) | Statistics rows to show on the endscreen. | ## Control -Specifies an possible control to the controller. +Specifies an possible control to the controller. There is a standardized set of possible controls to ensure cooperability between controllers. If your game needs additional controls you can use custom actions. + +### Standard control + +```JSON +{ + "type": "normal", + "action": "up", + "mode": "binary" +} + +``` + +| Attribute | Type | Description | +| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| type | "normal" | The type of control. | +| action | "left" / "right" / "up" / "down" / "upleft" / "upright" / "downleft" / "downright" / "start" / "select" / "back" / "identify" | The action to use. | +| mode | "binary" / "analog" | The mode of the control. Use binary for one step or use analog for multiple steps. | +| (Optional) steps | number | **Only works when mode is analog.** The amount of steps the action has. | + +### Custom control + +```JSON +{ + "type": "custom", + "action": "rotate", + "mode": "binary" +} + +``` + +| Attribute | Type | Description | +| ---------------- | ------------------- | ---------------------------------------------------------------------------------- | +| type | "normal" | The type of control. | +| action | string | Any custom action id. | +| mode | "binary" / "analog" | The mode of the control. Use binary for one step or use analog for multiple steps. | +| (Optional) steps | number | **Only works when mode is analog.** The amount of steps the action has. |