├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── ask-resources.json ├── instructions ├── 1-voice-user-interface.md ├── 2-customization.md ├── 2-lambda-function.md ├── 3-connect-vui-to-code.md ├── 4-testing.md ├── 5-customization.md ├── 6-publication.md ├── 7-cli.md └── images │ ├── arn.png │ ├── ask.png │ ├── availability.png │ ├── build.png │ ├── buttons-trivia.png │ ├── certification.png │ ├── cloudwatch.png │ ├── create-function.png │ ├── create-lambda.png │ ├── custom.png │ ├── distribution.png │ ├── dynamo.png │ ├── echo-buttons.png │ ├── endpoint-tab.png │ ├── endpoint.png │ ├── function-code.png │ ├── gadget-interfaces.png │ ├── interfaces.png │ ├── json.png │ ├── lambda.png │ ├── logs.png │ ├── role.png │ ├── save-endpoint.png │ ├── test-enable.png │ ├── test.png │ ├── uk-store.png │ ├── us-store.png │ └── useast.png ├── lambda └── custom │ ├── config │ ├── messages.js │ ├── questions.js │ └── settings.js │ ├── handlers │ ├── gamePlayHandlers.js │ ├── globalHandlers.js │ ├── rollCallHandlers.js │ └── startHandlers.js │ ├── index.js │ ├── package-lock.json │ ├── package.json │ └── utils │ ├── animations.js │ ├── directives.js │ ├── display.js │ ├── game.js │ ├── logger.js │ └── rollcall.js └── skill-package ├── interactionModels └── custom │ ├── de-DE.json │ ├── en-GB.json │ └── en-US.json └── skill.json /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Issue #, if available:* 2 | 3 | *Description of changes:* 4 | 5 | 6 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lambda/custom/node_modules 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check [existing open](https://github.com/alexa/skill-sample-nodejs-buttons-game-templates/issues), or [recently closed](https://github.com/alexa/skill-sample-nodejs-buttons-game-templates/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps 18 | * The version of our code being used 19 | * Any modifications you've made relevant to the bug 20 | * Anything unusual about your environment or deployment 21 | 22 | 23 | ## Contributing via Pull Requests 24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 25 | 26 | 1. You are working against the latest source on the *master* branch. 27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 29 | 30 | To send us a pull request, please: 31 | 32 | 1. Fork the repository. 33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 34 | 3. Ensure local tests pass. 35 | 4. Commit to your fork using clear commit messages. 36 | 5. Send us a pull request, answering any default questions in the pull request interface. 37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 38 | 39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | 43 | ## Finding contributions to work on 44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/alexa/skill-sample-nodejs-buttons-game-templates/labels/help%20wanted) issues is a great place to start. 45 | 46 | 47 | ## Code of Conduct 48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 50 | opensource-codeofconduct@amazon.com with any additional questions or comments. 51 | 52 | 53 | ## Security issue notifications 54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 55 | 56 | 57 | ## Licensing 58 | 59 | See the [LICENSE](https://github.com/alexa/skill-sample-nodejs-buttons-game-templates/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 60 | 61 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Amazon Software License 1.0 2 | 3 | This Amazon Software License ("License") governs your use, reproduction, and 4 | distribution of the accompanying software as specified below. 5 | 6 | 1. Definitions 7 | 8 | "Licensor" means any person or entity that distributes its Work. 9 | 10 | "Software" means the original work of authorship made available under this 11 | License. 12 | 13 | "Work" means the Software and any additions to or derivative works of the 14 | Software that are made available under this License. 15 | 16 | The terms "reproduce," "reproduction," "derivative works," and 17 | "distribution" have the meaning as provided under U.S. copyright law; 18 | provided, however, that for the purposes of this License, derivative works 19 | shall not include works that remain separable from, or merely link (or bind 20 | by name) to the interfaces of, the Work. 21 | 22 | Works, including the Software, are "made available" under this License by 23 | including in or with the Work either (a) a copyright notice referencing the 24 | applicability of this License to the Work, or (b) a copy of this License. 25 | 26 | 2. License Grants 27 | 28 | 2.1 Copyright Grant. Subject to the terms and conditions of this License, 29 | each Licensor grants to you a perpetual, worldwide, non-exclusive, 30 | royalty-free, copyright license to reproduce, prepare derivative works of, 31 | publicly display, publicly perform, sublicense and distribute its Work and 32 | any resulting derivative works in any form. 33 | 34 | 2.2 Patent Grant. Subject to the terms and conditions of this License, each 35 | Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free 36 | patent license to make, have made, use, sell, offer for sale, import, and 37 | otherwise transfer its Work, in whole or in part. The foregoing license 38 | applies only to the patent claims licensable by Licensor that would be 39 | infringed by Licensor's Work (or portion thereof) individually and 40 | excluding any combinations with any other materials or technology. 41 | 42 | 3. Limitations 43 | 44 | 3.1 Redistribution. You may reproduce or distribute the Work only if 45 | (a) you do so under this License, (b) you include a complete copy of this 46 | License with your distribution, and (c) you retain without modification 47 | any copyright, patent, trademark, or attribution notices that are present 48 | in the Work. 49 | 50 | 3.2 Derivative Works. You may specify that additional or different terms 51 | apply to the use, reproduction, and distribution of your derivative works 52 | of the Work ("Your Terms") only if (a) Your Terms provide that the use 53 | limitation in Section 3.3 applies to your derivative works, and (b) you 54 | identify the specific derivative works that are subject to Your Terms. 55 | Notwithstanding Your Terms, this License (including the redistribution 56 | requirements in Section 3.1) will continue to apply to the Work itself. 57 | 58 | 3.3 Use Limitation. The Work and any derivative works thereof only may be 59 | used or intended for use with the web services, computing platforms or 60 | applications provided by Amazon.com, Inc. or its affiliates, including 61 | Amazon Web Services, Inc. 62 | 63 | 3.4 Patent Claims. If you bring or threaten to bring a patent claim against 64 | any Licensor (including any claim, cross-claim or counterclaim in a 65 | lawsuit) to enforce any patents that you allege are infringed by any Work, 66 | then your rights under this License from such Licensor (including the 67 | grants in Sections 2.1 and 2.2) will terminate immediately. 68 | 69 | 3.5 Trademarks. This License does not grant any rights to use any 70 | Licensor's or its affiliates' names, logos, or trademarks, except as 71 | necessary to reproduce the notices described in this License. 72 | 73 | 3.6 Termination. If you violate any term of this License, then your rights 74 | under this License (including the grants in Sections 2.1 and 2.2) will 75 | terminate immediately. 76 | 77 | 4. Disclaimer of Warranty. 78 | 79 | THE WORK IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 80 | EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF 81 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR 82 | NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER 83 | THIS LICENSE. SOME STATES' CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN 84 | IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU. 85 | 86 | 5. Limitation of Liability. 87 | 88 | EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL 89 | THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE 90 | SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, 91 | INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR 92 | RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING 93 | BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS 94 | OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES 95 | OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF 96 | SUCH DAMAGES. 97 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Alexa Skill: Trivia Game 2 | Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build An Alexa 'Better with Buttons' Trivia Game 2 | 3 | 4 | **Important: The Gadgets Skill API is in beta and is subject to change at any time without notice. We welcome your feedback.** 5 | 6 | This Alexa sample skill is a template for a trivia game which is played with [Echo Buttons](https://www.amazon.com/Echo-Buttons-Alexa-Gadget-Pack/dp/B072C4KCQH) in multiplayer mode but can also be played without buttons in single player mode. Provided a list of interesting questions about a topic, Alexa will select a group of questions to ask the player(s), keep score throughout, and announce the winner at the end of the game. 7 | 8 | This sample skill demonstrates how to discover Echo Buttons using [roll call](https://developer.amazon.com/docs/gadget-skills/discover-echo-buttons.html#goals), how to [receive Echo Button events](https://developer.amazon.com/docs/gadget-skills/receive-echo-button-events.html), and how to [animate the Echo Button lights](https://developer.amazon.com/docs/gadget-skills/control-echo-buttons.html#animate). 9 | 10 | You may use this sample game as a starting point to build your own 'Better with Buttons' trivia game. You can customize Alexa's voice responses, the question list, and some game options without making changes to the code. However, to provide a truely unique game experience code changes will likely be necessary. 11 | 12 | ### About 13 | This guide assumes you have your developer environment ready to go and that you have some familiarity with CLI (Command Line Interface) Tools, [AWS](https://aws.amazon.com/), and the [ASK Developer Portal](https://developer.amazon.com/alexa-skills-kit). 14 | 15 | ### Pre-requisites 16 | 17 | * Node.js (> v8) 18 | * Register for an [AWS Account](https://aws.amazon.com/) 19 | * Register for an [Amazon Developer Account](https://developer.amazon.com) 20 | 21 | 22 | [![Get Started](https://camo.githubusercontent.com/db9b9ce26327ad3bac57ec4daf0961a382d75790/68747470733a2f2f6d2e6d656469612d616d617a6f6e2e636f6d2f696d616765732f472f30312f6d6f62696c652d617070732f6465782f616c6578612f616c6578612d736b696c6c732d6b69742f7475746f7269616c732f67656e6572616c2f627574746f6e732f627574746f6e5f6765745f737461727465642e5f5454485f2e706e67)](./instructions/1-voice-user-interface.md) 23 | 24 | Or click [here](./instructions/7-cli.md) for instructions using the ASK CLI (command line interface). 25 | 26 | ## Additional Resources 27 | 28 | ### Community 29 | * [Amazon Developer Forums](https://forums.developer.amazon.com/spaces/311/gadgets-beta.html) - Join the conversation! 30 | * [Hackster.io](https://www.hackster.io/amazon-alexa) - See what others are building with Alexa. 31 | 32 | ### Tutorials & Guides 33 | * [Voice Design Guide](https://developer.amazon.com/designing-for-voice/) - A great resource for learning conversational and voice user interface design. 34 | * [Codecademy: Learn Alexa](https://www.codecademy.com/learn/learn-alexa) - Learn how to build an Alexa Skill from within your browser with this beginner friendly tutorial on Codecademy! 35 | * [Echo Buttons Color Changer Sample Skill](https://github.com/alexa/skill-sample-nodejs-buttons-colorchanger) - A simpler skill that shows how to do roll call and control light animations for Echo Buttons. 36 | 37 | ### Documentation 38 | * [Official Alexa Skills Kit Node.js SDK](https://www.npmjs.com/package/ask-sdk) - The Official Node.js SDK Documentation 39 | * [Official Alexa Skills Kit Documentation](https://developer.amazon.com/docs/ask-overviews/build-skills-with-the-alexa-skills-kit.html) - Official Alexa Skills Kit Documentation 40 | * [Official Alexa Gadgets Documentation](https://developer.amazon.com/alexa/alexa-gadgets) - The Echo Buttons are the first Alexa Gadget 41 | 42 |

43 |
44 |
45 | 46 |

47 | -------------------------------------------------------------------------------- /ask-resources.json: -------------------------------------------------------------------------------- 1 | { 2 | "askcliResourcesVersion": "2020-03-31", 3 | "profiles": { 4 | "default": { 5 | "skillMetadata": { 6 | "src": "./skill-package" 7 | }, 8 | "code": { 9 | "default": { 10 | "src": "lambda/custom" 11 | } 12 | }, 13 | "skillInfrastructure": { 14 | "userConfig": { 15 | "runtime": "nodejs10.x", 16 | "handler": "index.handler", 17 | "awsRegion": "us-east-1" 18 | }, 19 | "type": "@ask-cli/lambda-deployer" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /instructions/1-voice-user-interface.md: -------------------------------------------------------------------------------- 1 | # Build An Alexa 'Better with Buttons' Trivia Game 2 | 3 | 4 | [![Voice User Interface](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/1-on._TTH_.png)](./1-voice-user-interface.md)[![Lambda Function](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/2-off._TTH_.png)](./2-lambda-function.md)[![Connect VUI to Code](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/3-off._TTH_.png)](./3-connect-vui-to-code.md)[![Testing](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/4-off._TTH_.png)](./4-testing.md)[![Customization](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/5-off._TTH_.png)](./5-customization.md)[![Publication](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/navigation/6-off._TTH_.png)](./6-publication.md) 5 | 6 | 1. Go to the **[Amazon Developer Portal](https://developer.amazon.com/alexa)**. In the top-right corner of the screen, click the **Sign In** button. 7 | (If you don't already have an account, you will be able to create a new one for free.) 8 | 9 | 2. Once you have signed in move your mouse over the **Your Alexa Consoles** text at the top of the screen and Select the **Skills** Link. 10 | 11 | 3. From the **Alexa Skills Kit Developer Console** select the blue **Create Skill** button on the right side of the screen. 12 | 13 | 4. Give your new skill a **Name**. This is the name that will be shown in the Alexa Skills Store, and the name your users will refer to. 14 | 15 | 5. Select the **Custom** model from the list at the bottom of the page and then click the **Create Skill** button at the top right. 16 | 17 | ![JSON Editor](./images/custom.png) 18 | 19 | 6. **Build the Interaction Model for your skill** 20 | 1. On the left hand navigation panel, select the **JSON Editor** tab. In the textfield provided, replace any existing code with the code provided in the [Interaction Model](../models) (make sure to pick the model that matches your skill's language). 21 | 22 | ![JSON Editor](./images/json.png) 23 | 24 | 2. Next, select the **Invocation** tab. Change the **Skill Invocation Name** from the default provided. This is the name that your users will need to say to start your skill. 25 | 3. Click **Save Model**. 26 | 27 | **Note:** You should notice that **Intents** and **Slot Types** will auto populate based on the JSON Interaction Model that you have now applied to your skill. Feel free to explore the changes here, to learn about **Intents**, **Slots**, and **Utterances** open our [technical documentation in a new tab](https://developer.amazon.com/docs/custom-skills/create-intents-utterances-and-slots.html). 28 | 29 | 7. **Optional:** Select an intent by expanding the **Intents** from the left side navigation panel. Add some more sample utterances for your newly generated intents. Think of all the different ways that a user could request to make a specific intent happen. A few examples are provided. Be sure to click **Save Model** and **Build Model** after you're done making changes here. 30 | 31 | 8. **Enable Interfaces for Your Game** 32 | 1. On the left hand navigation panel, select the **Interfaces** tab. 33 | 34 | ![Interfaces](./images/interfaces.png) 35 | 36 | 2. On the resulting page enable the **Display Interface**, **Gadget Controller**, and **Game Engine**. 37 | 38 | ![Gadget Interfaces](./images/gadget-interfaces.png) 39 | 40 | 3. Click **Save Interfaces** and then **Build Model**. 41 | 42 | 9. If your interaction model builds successfully, proceed to the next step. If not, you should see an error. Try to resolve the errors. In our next step of this guide, we will be creating our Lambda function in the AWS developer console, but keep this browser tab open, because we will be returning here on [Page #3: Connect VUI to Code](./3-connect-vui-to-code.md). 43 | 44 | 45 | If you get an error from your interaction model, check through this list: 46 | 47 | * **Did you copy & paste the provided code correctly?** 48 | * **Did you accidentally add any characters to the Interaction Model or Sample Utterances?** 49 | 50 | [![Next](https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/general/buttons/button_next_lambda_function._TTH_.png)](./2-lambda-function.md) 51 | -------------------------------------------------------------------------------- /instructions/2-customization.md: -------------------------------------------------------------------------------- 1 | ![](https://images-na.ssl-images-amazon.com/images/G/01/kindle/dp/2017/4911315144/LP_AG_HERO_BANNER_1334x389.jpg) 2 | 3 | 4 | # Echo Button Game Template 5 | 6 | **Important: The Gadgets Skill API is in beta and is subject to change at any time without notice. We welcome your feedback.** 7 | 8 | These instructions show how to customize the Trivia Template skill. 9 | 10 | # How to configure your game skill 11 | 12 | ## Introduction 13 | This Echo Button Game Template provides a way for you to customize your skill without necessarily writing code. You can affect the following features through configuration only: 14 | * Roll Call Behavior 15 | * Questions and Answers. 16 | * Total number of questions to be asked per game 17 | * Total number of questions asked/answered before a score summary is shared with the players 18 | * Button colors to indicate 19 | * Answer/buzz-in readiness 20 | * First to buzz-in 21 | * Missed buzz-in 22 | * Correct answers 23 | * Incorrect answers 24 | * Sound effects, including: 25 | * When roll call is complete 26 | * When the skill is waiting for buttons to be pressed after asking a question 27 | * When a user presses their button 28 | * When a user's answer is correct 29 | * When a user's answer is incorrect. 30 | * Changing the background, correct and incorrect images on Echo Show and Echo Spot devices 31 | * Changing the maximum number of players 32 | * Changing the acceptable answer threshold 33 | 34 | ## Changing the roll call behavior 35 | You can change the [roll call](https://developer.amazon.com/docs/gadget-skills/discover-echo-buttons.html#goals) behavior for the template by changing `ROLL_CALL` value in the [settings file](lambda/custom/config/settings.js) 36 | ``` 37 | /** 38 | * ROLLCALL - Control how players register themselves for the game 39 | * QUICK_START 40 | * Allows for all buttons up to GAME.MAX_PLAYERS to press their buttons during 41 | * roll call before the skill will decide they are registered 42 | * NAMED_PLAYERS 43 | * On each button press up to GAME.MAX_PLAYERS, acknowledge the button press 44 | * and call the player out by name 45 | */ 46 | ROLLCALL : { 47 | QUICK_START : true, 48 | NAMED_PLAYERS: false 49 | } 50 | ``` 51 | ### `QUICK_START` mode 52 | When setting `QUICK_START` to `true`, this means the skill will allow all buttons up to [MAX_PLAYERS](#changing-the-maximum-number-of-players) to be pressed before acknowledging that all players are registered and continuing with the game 53 | 54 | ### `NAMED_PLAYERS` mode 55 | When setting `NAMED_PLAYERS` to `true`, Alexa will acknowledge each player when they press their button during [roll call](https://developer.amazon.com/docs/gadget-skills/discover-echo-buttons.html#goals) by saying 'Hello, player #' where # is a value between 1 and [MAX_PLAYERS](#changing-the-maximum-number-of-players) 56 | 57 | ## Changing the questions and answers 58 | This sample comes with a list of 10 default animal based questions located in [questions.js](lambda/custom/config/questions.js) which you can modify to your liking. 59 | ``` 60 | { 61 | index: 1, 62 | question: 'What is the name for a group of lions?', 63 | answers: ['pack', 'pride', 'den', 'frat'], 64 | correct_answer: 'pride' 65 | } 66 | ``` 67 | 68 | The question objects in the array have the following properties per question: 69 | * `index` - The ordinal position of the question in the list. Questions will be fetched per this numbering. 70 | * `question` - The question to be asked. 71 | * `answers` - The list of answer options to read to the user. 72 | * `correct_answer` - The correct answer for the question. 73 | 74 | ### Interaction Model Dependencies 75 | You must add any new values in the `answers` array to the `{answers}` slot in your Alexa skill's interaction model. See the section on building the [interaction model](#step-4-create-an-interaction-model) for instructions on how to do that. 76 | 77 | 78 | ## Changing the button colors 79 | You can also adjust the button colors show to the users for the different button events and states in the game. 80 | In general, you want to use visual cueing in the form of button colors to indicate different states and readiness for your game. 81 | ``` 82 | COLORS : { 83 | // Color you want the buttons to be when expecting input 84 | QUESTION_COLOR: 'purple', 85 | // Color you want the first button to chime in to be 86 | BUZZ_IN_COLOR: 'blue', 87 | // Color you want the other buttons who didn't chime in 88 | MISSED_BUZZ_IN: 'black', 89 | // Incorrect answer color 90 | INCORRECT_COLOR: 'red', 91 | // Correct color 92 | CORRECT_COLOR: 'green' 93 | } 94 | ``` 95 | You can affect the the above list by changing the string value for the color. However, you must make sure the string and its corresponding hex value are present in [colorsList.js](lambda/custom/button_animations/colorsList.js) and if not, you will need to add a mapping of the color's string value, for example `fuschia` to its hex value `FF00FF` to the array of colors in the [colorsList.js](lambda/custom/button_animations/colorsList.js) file. 96 | ``` 97 | { 98 | "value":"FF00FF", 99 | "name":"fuschia" 100 | } 101 | ``` 102 | ## Changing the sounds 103 | You can change the sounds in the game by changing the value for the `