Inspiration

This game is based on a card game where you try to guess if the next card in the deck is higher or lower than your current card, or if it is red or black. This game was inspired in part by my wife.

What it does

This is a simple guessing game. The skill starts the player with 2 lives. A deck of 52 random cards are shuffled and placed into a "game deck". The player is presented with the first card and must guess whether it is higher, lower, red, or black. If the player guesses correctly, one point is awarded. If the player guesses incorrectly, no point is awarded. If 3 guesses in a row are incorrect, the player loses a life. When lives are exhausted the game is over, but the player has the ability to purchase extra lives. Extra life purchases are $0.99 for 4 lives.

How I built it

This skill was written as an Alexa hosted skill using javascript. The interaction model was built in the alexa developer console. Front-end Alexa interactions pass directives in a json file to the back-end javascript code for processing to handle requests.

Challenges I ran into

This is the first skill I have written that incorporates S3 persistence and In Skill Product. I ran into issues correctly writing and reading values to and from S3 storage. Once I figured out how to correctly manage attributes by using getPersistentAttributes and setPersistentAttributes, pushing and pulling stored values became easier.
The challenge for the In Skill Products came the depth of the javascript object associated with making a purchase. It took some time and trial and error to get to a point where i could correctly pull the correct value for the number of times a user has purchased the product. Once that confusion was cleared, I was able to use that information to correctly compare the amount purchased to the amount that has been consumed and upsell when necessary.

Accomplishments that I'm proud of

I am proud of the fact that I was able to push and pull the data that needed to be processed correctly. If I were not able to get correct information, then the skill would have no functionality. I am also especially proud of the use of APL in this skill. The skill utilizes multiple APL outputs for different stages of the skill, with different layouts for different screen types. Certain types of screen also utilize touchwrappers for touchscreen input.

What I learned

For this skill I learned: how to use S3 Persistence adapters how to pass information with a .js file how incorporate in skill products how to use touchwrappers and pagers in APL

What's next for Ride the Bus

Eventually, I would like to incorporate more features into this game. I would like to see a two player version for people go head to head. I would also like to create a leaderboard to track high scores. Maybe even creating a badge system for achievements.

Share this project:
×

Updates