{"id":13832388,"url":"https://github.com/alexa-samples/skill-sample-nodejs-adventure-game","last_synced_at":"2025-07-09T16:35:44.394Z","repository":{"id":45552261,"uuid":"61861729","full_name":"alexa-samples/skill-sample-nodejs-adventure-game","owner":"alexa-samples","description":"This tool provides an easy to use front-end that allows developers to instantly deploy code for your story, or use the generated code as a starting point for more complex projects.","archived":true,"fork":false,"pushed_at":"2022-12-08T23:35:38.000Z","size":993,"stargazers_count":510,"open_issues_count":53,"forks_count":218,"subscribers_count":86,"default_branch":"master","last_synced_at":"2024-08-05T10:21:06.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexa-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-24T06:25:39.000Z","updated_at":"2024-05-19T01:03:46.000Z","dependencies_parsed_at":"2023-01-25T18:30:07.338Z","dependency_job_id":null,"html_url":"https://github.com/alexa-samples/skill-sample-nodejs-adventure-game","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexa-samples%2Fskill-sample-nodejs-adventure-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexa-samples%2Fskill-sample-nodejs-adventure-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexa-samples%2Fskill-sample-nodejs-adventure-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexa-samples%2Fskill-sample-nodejs-adventure-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexa-samples","download_url":"https://codeload.github.com/alexa-samples/skill-sample-nodejs-adventure-game/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225575407,"owners_count":17490750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T10:02:01.655Z","updated_at":"2024-11-20T14:31:04.859Z","avatar_url":"https://github.com/alexa-samples.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"#  Build An Alexa Gamebook Skill\n\u003cimg src=\"https://m.media-amazon.com/images/G/01/mobile-apps/dex/alexa/alexa-skills-kit/tutorials/fact/header._TTH_.png\" /\u003e\n\n\nThis Alexa sample skill is a template for a basic gamebook skill. Provided with a branching text adventure from the Twine 2 platform, Alexa will let you play a game.\n\nIf this is your first time here, you're new to Alexa Skills Development, or you're looking for more detailed instructions, click the **Get Started** button below:\n\n\u003cp align='center'\u003e\n\u003ca href='./instructions/0-intro.md'\u003e\u003cimg src='https://camo.githubusercontent.com/db9b9ce26327ad3bac57ec4daf0961a382d75790/68747470733a2f2f6d2e6d656469612d616d617a6f6e2e636f6d2f696d616765732f472f30312f6d6f62696c652d617070732f6465782f616c6578612f616c6578612d736b696c6c732d6b69742f7475746f7269616c732f67656e6572616c2f627574746f6e732f627574746f6e5f6765745f737461727465642e5f5454485f2e706e67'\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\nBe sure to take a look at the [Additional Resources](#additional-resources) at the bottom of this page!\n\n\n## About\n**Note:** The rest of this readme 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). If not, [click here](./instructions/0-intro.md) for a more detailed walkthrough.\n\n\n\n### Usage\n\n```text\nAlexa, ask Text Adventure where am I?\n\t\u003e\u003e You are in the main hall of a large castle. Heavy tapestries hang from the walls...\n```\n```text\nAlexa, start Text Adventure\n\t\u003e\u003e You're in a small office, there is a door to your left...\n```\n\n### Repository Contents\n* `/.ask`\t- [ASK CLI (Command Line Interface) configuration](https://developer.amazon.com/docs/smapi/ask-cli-intro.html)\t \n* `/instructions` - Step-by-step instructions for getting started\n* `/lambda/custom` - Back-end logic for the Alexa Skill hosted on [AWS Lambda](https://aws.amazon.com/lambda/)\n* `/models/en-US.json` - ASK CLI interaction model for US English\n* `skill.json`\t- [Skill Manifest](https://developer.amazon.com/docs/smapi/skill-manifest.html)\n\n## Setup w/ ASK CLI\n\n### Pre-requisites\n\n* Node.js (\u003e v4.3)\n* Register for an [AWS Account](https://aws.amazon.com/)\n* Register for an [Amazon Developer Account](https://developer.amazon.com/)\n* Install and setup [ASK CLI](https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html)\n\n### Installation\n1. Clone the repository.\n\n\t```bash\n\t$ git clone https://github.com/alexa/skill-sample-gamebook/\n\t```\n\n2. Initialize the [ASK CLI](https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html) by navigating into the repository and running npm command: `ask init`. Follow the prompts.\n\n\t```bash\n\t$ cd skill-sample-gamebook\n\t$ ask init\n\t```\n\n3. Install npm dependencies by navigating into the `lambda/custom` directory and running the npm command: `npm install`\n\n\t```bash\n\t$ cd lambda/custom\n\t$ npm install\n\t```\n\n\n### Deployment\n\nASK CLI will create the skill and the Lambda function for you. The Lambda function will be created in ```us-east-1 (Northern Virginia)``` by default.\n\n1. Deploy the skill and the Lambda function in one step by running the following command:\n\n\t```bash\n\t$ ask deploy\n\t```\n\n### Testing\n\n1. Log in to the [Alexa Developer Console](https://developer.amazon.com/edw/home.html#/skills), open your skill, and from the **Test** tab enable the **Test switch**.\n\n2. Simulate verbal interaction with your skill through the command line using the following example:\n\n\t```bash\n\t $ ask simulate -l en-US -t \"start Text Adventure\"\n\n\t ✓ Simulation created for simulation id: 4a7a9ed8-94b2-40c0-b3bd-fb63d9887fa7\n\t◡ Waiting for simulation response{\n\t  \"status\": \"SUCCESSFUL\",\n\t  ...\n\t ```\n\n3. With the **Test switch** enabled, your skill can also be tested on devices associated with your developer account. Speak to Alexa through any enabled physical device, through your browser with [echosim.io](https://echosim.io/welcome), or through your Amazon Mobile App and say:\n\n\t```text\n\tstart Text Adventure\n\t```\n\n## Customization\n\n1. Amend ```./skill.json```\n\n\tChange the skill name, example phrase, icons, testing instructions, etc ...\n\n\tRemember that interaction models are locale-specific and must be changed for each locale (en-US, en-GB, de-DE, etc.).\n\n\tSee the Skill [Manifest Documentation](https://developer.amazon.com/docs/smapi/skill-manifest.html) for more information.\n\n2. Amend ```./lambda/custom/index.js```\n\n\tModify messages, and facts from the source code to customize the skill.\n\n3. Amend ```./models/*.json```\n\n\tChange the model definition to replace the invocation name and the sample phrase for each intent.  Repeat the operation for each locale you are planning to support.\n\n4. Open the [Twine 2 online editor](http://twinery.org/2)\n\n\tTwine 2 is a text adventure authoring platform. It is capable of creating quite complex standalone games using variables and plug-ins. For our purposes we use it to create a simple text-and-choice-based branching game.\n\n\tNote that we are **not** using Twine variables. We leave this as a programming task for any enthused developers.\n\n\tYou can use the online editor or download and install it as a desktop app.\n\n\tWe aren't going to teach you how to use Twine here, but if you import the sample game it will give you a head-start.\n\n\tLater, when you are developing your own Alexa skills, remember that Twine can be very useful for designing voice interaction flows.\n\n5. Import and play the sample game\n\n\tIn the main right-hand menu click on **Import From File**.\n\n\tImport the sample game [Escape the Office.html](../lambda/custom/Escape the Office.html)\n\n## Additional Resources\n\n### Community\n* Our team of evangelists run [online office hours every Tuesday from 1-2pm Pacific Time](https://attendee.gotowebinar.com/rt/8389200425172113931).\n* [Amazon Developer Forums](https://forums.developer.amazon.com/spaces/165/index.html) - Join the conversation!\n* [Hackster.io](https://www.hackster.io/amazon-alexa) - See what others are building with Alexa.\n* [Alexa Developers Slack Channel](http://www.alexaslack.com/) - Chat with other Alexa developers. This is not an official Amazon channel.\n\n### Tutorials \u0026 Guides\n* [Voice Design Guide](https://developer.amazon.com/designing-for-voice/) - A great resource for learning conversational and voice user interface design.\n* [CodeAcademy: 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 CodeAcademy!\n\n### Documentation\n* [Official Alexa Skills Kit Node.js SDK](https://www.npmjs.com/package/alexa-sdk) - The Official Node.js SDK Documentation\n*  [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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexa-samples%2Fskill-sample-nodejs-adventure-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexa-samples%2Fskill-sample-nodejs-adventure-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexa-samples%2Fskill-sample-nodejs-adventure-game/lists"}