Inspiration
Being able to chat with a device in your home is really amazing. Sometimes you just need to ask or say something to Alexa and get a fun response and it makes all the difference.
What it does
This game is designed to help relieve stress and to provide users with a positive outlook of the day, wake up a user’s mind just a little and bring some cheer.
The game host (Alexa) request the user to guess a number between 0 and 100 and tells a virtual opponent (a computer) to also guess a number. Then the game host reveals if the user or the computer picked a number closer to the one the game host had in mind. It’s a simple guessing game where the user sees conceptually, the likelihood of being luckier than a computer. When the user does not win, the game host suggests to keep trying to show that the user’s luck will change. As the game progresses, the game host (modeling a little after the idea of a game show host) asks the user to to consider options before playing their next number. Sometimes providing hints. Also at times the host shares interesting facts about the number that the user chooses.
This game is good to play to get some encouragement, great to start the day with or play at anytime. The game begins and ends with cool messages and the user can also ask for “lucky quotes” too. Many of the quotes aim to be funny and motivational. All quotes are original material not available anywhere except this skill.
To make the conversation even better the game provides many random responses and catches for if the user says something unexpected like, guessing a number greater than 99.
On Alexa devices with screens, the player, the opponent (virtual computer) and the game host are at times represented by avatars. Tapping on the avatars presents additional responses.
There is also a simple ‘yes or no’ survey built in where the game asks the user if they would like more quotes added with the hope that the user can provide useful feedback on the quotes.
How I built it
AWS Lambda Deployment using Node.js, Alexa Skills Kit SDK, Alexa Presentation Language (APL), Amazon DynamoDB and Alexa Developer Console.
Challenges I ran into
Sometimes the voice synthesizer produced unexpected word pronunciations based on the sentence the words appeared in. However, it was possible to get better results by using simple word substitutes and well placed pauses. Amazon is always improving Alexa’s voice reproduction capabilities. So I believe the skill will eventually get improvements to the speech output without any additional effort by me! Displaying long quotes on the small hub presented a challenge. APL provided the solution with use of a ScrollView to prevent the text from accidentally going beyond the space allocated for it.
Accomplishments that I'm proud of
With Alexa Presentation Language (APL) it is possible to generate a real-time visual of the game results. This is very useful since at times it’s hard to mentally visualize how close or far the user’s guessed number is from the target number relative to the opponent’s number. I wanted to make sure the game can work well without the need for a screen and I believe it does. The voice output clearly states if the user won or if the computer did. With APL it was possible to create a graphical ruler with a scale showing positions 0 to 100 and place icons (avatars) for the user, computer and target (game host) at their positions on the scale, making it super easy for the user to see the results to determine just how lucky the guess really was. (Not used on the small hub) With the reusability of the templates it became very easy to make more use of visuals, including animation effects and to format them to the various screen sizes.
What I learned
There is so much cool stuff you can do with Alexa that the more you build the more you realize what is possible. It feels like you’re working with the technology of the future. The new Alexa Developer Console is great for building the Interaction Model and AWS Lambda is awesome too.
What's next for I am lucky
More inspirational quotes and more facts about numbers. May add more visuals, for example pictures to accompany some of the jokes and quotes. This is going to be really easy to do with the use of the APL template in place.
Built With
- alexa-skills-kit-sdk
- amazon-dynamodb
- aws-lambda
- love-for-alexa
- node.js
Log in or sign up for Devpost to join the conversation.